Qt: bugfix for wrong reported windowstate when we minimize maximized window.

git-svn-id: trunk@20886 -
This commit is contained in:
zeljko 2009-07-18 10:47:16 +00:00
parent fd84610a3c
commit 222aa23fd7
2 changed files with 15 additions and 9 deletions

View File

@ -188,6 +188,7 @@ type
function getTextStatic: Boolean; virtual;
function getHeight: Integer;
function getWidth: Integer;
function getWindowState: QtWindowStates;
procedure grabMouse; virtual;
function hasFocus: Boolean; virtual;
procedure lowerWidget; virtual;
@ -2743,7 +2744,7 @@ begin
Msg.Msg := LM_SIZE;
case QWidget_windowState(Widget) of
case getWindowState of
QtWindowMinimized: Msg.SizeType := SIZEICONIC;
QtWindowMaximized: Msg.SizeType := SIZEFULLSCREEN;
QtWindowFullScreen: Msg.SizeType := SIZEFULLSCREEN;
@ -3081,6 +3082,11 @@ begin
Result := QWidget_width(Widget);
end;
function TQtWidget.getWindowState: QtWindowStates;
begin
Result := QWidget_windowState(Widget);
end;
function TQtWidget.getClientBounds: TRect;
begin
QWidget_contentsRect(getContainerWidget, @Result);
@ -4360,14 +4366,14 @@ begin
FillChar(Msg, SizeOf(Msg), #0);
Msg.Msg := LM_SIZE;
Msg.SizeType := SIZENORMAL;
case QWidget_windowState(Widget) of
QtWindowMinimized: Msg.SizeType := SIZEICONIC;
QtWindowMaximized: Msg.SizeType := SIZEFULLSCREEN;
QtWindowFullScreen: Msg.SizeType := SIZEFULLSCREEN;
if getWindowState and QtWindowMinimized <> 0 then
Msg.SizeType := SIZEICONIC
else
Msg.SizeType := SIZENORMAL;
end;
if (getWindowState and QtWindowFullScreen <> 0) or
(getWindowState and QtWindowMaximized <> 0) then
Msg.SizeType := SIZEFULLSCREEN;
Msg.SizeType := Msg.SizeType or Size_SourceIsInterface;

View File

@ -4807,7 +4807,7 @@ begin
Result := False;
Widget := TQTWidget(hWnd);
Widget := TQtWidget(hWnd);
if Widget <> nil then
begin
@ -4817,7 +4817,7 @@ begin
SW_MINIMIZE: Widget.setWindowState(QtWindowMinimized);
SW_SHOWMINIMIZED: Widget.ShowMinimized;
SW_SHOWMAXIMIZED: Widget.ShowMaximized;
SW_HIDE: TQTWidget(hWnd).setVisible(False);
SW_HIDE: Widget.setVisible(False);
end;
Result := True;
end;