mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 02:16:09 +02:00
Qt: properly handle designed forms. Now IDE minimizing also minimize designed forms.
git-svn-id: trunk@47674 -
This commit is contained in:
parent
40d96c7e79
commit
d457ad2a3e
@ -360,8 +360,9 @@ begin
|
|||||||
AForm := Screen.CustomFormsZOrdered[i];
|
AForm := Screen.CustomFormsZOrdered[i];
|
||||||
if (AForm.Parent=nil) and AForm.HandleAllocated and
|
if (AForm.Parent=nil) and AForm.HandleAllocated and
|
||||||
TQtWidget(AForm.Handle).getVisible and
|
TQtWidget(AForm.Handle).getVisible and
|
||||||
not (AForm.FormStyle in [fsMDIChild, fsSplash]) and
|
((not (AForm.FormStyle in [fsMDIChild, fsSplash]) and
|
||||||
not (AForm.BorderStyle in [bsNone]) then
|
not (AForm.BorderStyle = bsNone)) or
|
||||||
|
(csDesigning in AForm.ComponentState)) then
|
||||||
begin
|
begin
|
||||||
States := TQtMainWindow(AForm.Handle).getWindowState;
|
States := TQtMainWindow(AForm.Handle).getWindowState;
|
||||||
if not TQtMainWindow(AForm.Handle).isMinimized then
|
if not TQtMainWindow(AForm.Handle).isMinimized then
|
||||||
@ -391,8 +392,9 @@ begin
|
|||||||
AForm := Screen.CustomFormsZOrdered[i];
|
AForm := Screen.CustomFormsZOrdered[i];
|
||||||
if (AForm.Parent=nil) and AForm.HandleAllocated and
|
if (AForm.Parent=nil) and AForm.HandleAllocated and
|
||||||
TQtWidget(AForm.Handle).getVisible and
|
TQtWidget(AForm.Handle).getVisible and
|
||||||
not (AForm.FormStyle in [fsMDIChild, fsSplash]) and
|
((not (AForm.FormStyle in [fsMDIChild, fsSplash]) and
|
||||||
not (AForm.BorderStyle in [bsNone]) then
|
not (AForm.BorderStyle = bsNone)) or
|
||||||
|
(csDesigning in AForm.ComponentState)) then
|
||||||
begin
|
begin
|
||||||
States := TQtMainWindow(AForm.Handle).getWindowState;
|
States := TQtMainWindow(AForm.Handle).getWindowState;
|
||||||
if TQtMainWindow(AForm.Handle).isMinimized then
|
if TQtMainWindow(AForm.Handle).isMinimized then
|
||||||
|
@ -3945,7 +3945,8 @@ begin
|
|||||||
{$IFDEF HASX11}
|
{$IFDEF HASX11}
|
||||||
if (LCLObject is TCustomForm) and EqualRect(FrameRect, WindowRect) and
|
if (LCLObject is TCustomForm) and EqualRect(FrameRect, WindowRect) and
|
||||||
(TCustomForm(LCLObject).BorderStyle <> bsNone) and
|
(TCustomForm(LCLObject).BorderStyle <> bsNone) and
|
||||||
not (TCustomForm(LCLObject).FormStyle in [fsMDIChild,fsSplash]) then
|
(not (TCustomForm(LCLObject).FormStyle in [fsMDIChild,fsSplash]) or
|
||||||
|
(csDesigning in LCLObject.ComponentState)) then
|
||||||
begin
|
begin
|
||||||
ACurrPos := getPos;
|
ACurrPos := getPos;
|
||||||
// do not send garbage to LCL. This window isn't decorated yet by WM.
|
// do not send garbage to LCL. This window isn't decorated yet by WM.
|
||||||
|
@ -194,7 +194,7 @@ begin
|
|||||||
AForm.BorderIcons, AForm.FormStyle);
|
AForm.BorderIcons, AForm.FormStyle);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if not (AForm.FormStyle in [fsMDIChild]) and
|
if (not (AForm.FormStyle in [fsMDIChild]) or (csDesigning in AForm.ComponentState)) and
|
||||||
(Application <> nil) and
|
(Application <> nil) and
|
||||||
(Application.MainForm <> nil) and
|
(Application.MainForm <> nil) and
|
||||||
(Application.MainForm.HandleAllocated) and
|
(Application.MainForm.HandleAllocated) and
|
||||||
@ -203,14 +203,16 @@ begin
|
|||||||
if (AForm.ShowInTaskBar in [stDefault, stNever])
|
if (AForm.ShowInTaskBar in [stDefault, stNever])
|
||||||
{$ifdef HASX11}
|
{$ifdef HASX11}
|
||||||
{QtTool have not minimize button !}
|
{QtTool have not minimize button !}
|
||||||
and not (AForm.BorderStyle in [bsSizeToolWin, bsToolWindow])
|
and (not (AForm.BorderStyle in [bsSizeToolWin, bsToolWindow]) or
|
||||||
|
(csDesigning in AForm.ComponentState))
|
||||||
{$endif} then
|
{$endif} then
|
||||||
QtMainWindow.setShowInTaskBar(False);
|
QtMainWindow.setShowInTaskBar(False);
|
||||||
if Assigned(AForm.PopupParent) then
|
if Assigned(AForm.PopupParent) then
|
||||||
PopupParent := TQtWidget(AForm.PopupParent.Handle).Widget
|
PopupParent := TQtWidget(AForm.PopupParent.Handle).Widget
|
||||||
else
|
else
|
||||||
PopupParent := nil;
|
PopupParent := nil;
|
||||||
QtMainWindow.setPopupParent(AForm.PopupMode, PopupParent);
|
if not (csDesigning in AForm.ComponentState) then
|
||||||
|
QtMainWindow.setPopupParent(AForm.PopupMode, PopupParent);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFDEF HASX11}
|
{$IFDEF HASX11}
|
||||||
@ -226,9 +228,9 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
QtMainWindow.MenuBar.AttachEvents;
|
QtMainWindow.MenuBar.AttachEvents;
|
||||||
|
|
||||||
if (AForm.FormStyle in [fsMDIChild]) and
|
if not (csDesigning in AForm.ComponentState) and
|
||||||
(Application.MainForm.FormStyle = fsMdiForm) and
|
(AForm.FormStyle in [fsMDIChild]) and
|
||||||
not (csDesigning in AWinControl.ComponentState) then
|
(Application.MainForm.FormStyle = fsMdiForm) then
|
||||||
begin
|
begin
|
||||||
QMdiArea_addSubWindow(
|
QMdiArea_addSubWindow(
|
||||||
QMdiAreaH(TQtMainWindow(Application.MainForm.Handle).MDIAreaHandle.Widget),
|
QMdiAreaH(TQtMainWindow(Application.MainForm.Handle).MDIAreaHandle.Widget),
|
||||||
@ -377,7 +379,7 @@ begin
|
|||||||
(Application.MainForm <> AForm) then
|
(Application.MainForm <> AForm) then
|
||||||
Enable := false;
|
Enable := false;
|
||||||
{$IFDEF HASX11}
|
{$IFDEF HASX11}
|
||||||
if AForm.FormStyle <> fsMDIChild then
|
if (AForm.FormStyle <> fsMDIChild) then
|
||||||
SetSkipX11Taskbar(TQtMainWindow(AForm.Handle).Widget, not Enable);
|
SetSkipX11Taskbar(TQtMainWindow(AForm.Handle).Widget, not Enable);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
TQtMainWindow(AForm.Handle).setShowInTaskBar(Enable);
|
TQtMainWindow(AForm.Handle).setShowInTaskBar(Enable);
|
||||||
@ -505,7 +507,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if TForm(AWinControl).FormStyle <> fsMDIChild then
|
if (TForm(AWinControl).FormStyle <> fsMDIChild) or
|
||||||
|
(csDesigning in AWinControl.ComponentState) then
|
||||||
begin
|
begin
|
||||||
if (csDesigning in AWinControl.ComponentState) and
|
if (csDesigning in AWinControl.ComponentState) and
|
||||||
(TCustomForm(AWinControl).WindowState = wsMaximized) then
|
(TCustomForm(AWinControl).WindowState = wsMaximized) then
|
||||||
|
Loading…
Reference in New Issue
Block a user