mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 18:27:48 +02:00
AnchorDocking: Fixed third bug with option FloatingWindowsOnTop - loading layout in OnCreate doesn't permute this option. Issue #19272
git-svn-id: trunk@65051 -
This commit is contained in:
parent
6c6ce16b28
commit
6f18e2cc44
@ -2785,19 +2785,25 @@ end;
|
|||||||
procedure TAnchorDockMaster.SetFloatingWindowsOnTop(AValue: boolean);
|
procedure TAnchorDockMaster.SetFloatingWindowsOnTop(AValue: boolean);
|
||||||
var
|
var
|
||||||
i, AIndex: Integer;
|
i, AIndex: Integer;
|
||||||
AForm, ParentForm: TCustomForm;
|
AMainForm, AForm, ParentForm: TCustomForm;
|
||||||
IsMainForm: Boolean;
|
IsMainForm: Boolean;
|
||||||
AFormStyle: TFormStyle;
|
AFormStyle: TFormStyle;
|
||||||
begin
|
begin
|
||||||
if FFloatingWindowsOnTop = AValue then Exit;
|
if FFloatingWindowsOnTop = AValue then Exit;
|
||||||
FFloatingWindowsOnTop := AValue;
|
FFloatingWindowsOnTop := AValue;
|
||||||
|
AMainForm := nil;
|
||||||
for i:=0 to Screen.FormCount-1 do
|
for i:=0 to Screen.FormCount-1 do
|
||||||
begin
|
begin
|
||||||
AForm := Screen.Forms[i];
|
AForm := Screen.Forms[i];
|
||||||
ParentForm := GetParentForm(AForm);
|
ParentForm := GetParentForm(AForm);
|
||||||
IsMainForm := (AForm = Application.MainForm)
|
// Workaround: if FloatingWindowsOnTop is loaded on MainForm.Create
|
||||||
or (AForm.IsParentOf(Application.MainForm))
|
// Application.MainForm is not set now, but already in Screen.Forms
|
||||||
or (ParentForm = Application.MainForm);
|
// see https://bugs.freepascal.org/view.php?id=19272
|
||||||
|
if not Assigned(AMainForm) then AMainForm := Application.MainForm;
|
||||||
|
if not Assigned(AMainForm) then AMainForm := Screen.Forms[0];
|
||||||
|
IsMainForm := (AForm = AMainForm)
|
||||||
|
or (AForm.IsParentOf(AMainForm))
|
||||||
|
or (ParentForm = AMainForm);
|
||||||
if IsMainForm then Continue;
|
if IsMainForm then Continue;
|
||||||
if AValue then
|
if AValue then
|
||||||
AFormStyle := fsStayOnTop
|
AFormStyle := fsStayOnTop
|
||||||
|
Loading…
Reference in New Issue
Block a user