mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-10 21:58:22 +02:00
AnchorDocking: Fixed ChangeBounds loop detected. Issue #31238
git-svn-id: trunk@54525 -
This commit is contained in:
parent
e800a738ad
commit
6139a22bcf
@ -1465,13 +1465,40 @@ function TAnchorDockMaster.CloseUnneededControls(Tree: TAnchorDockLayoutTree
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
AControl: TControl;
|
AControl: TControl;
|
||||||
|
TreeNodeControl: TAnchorDockLayoutTreeNode;
|
||||||
|
|
||||||
|
function ParentsIdentical: Boolean;
|
||||||
|
var
|
||||||
|
ParentForm: TCustomForm;
|
||||||
|
ParentAnchorDockLayoutTreeNode: TAnchorDockLayoutTreeNode;
|
||||||
|
Parent1, Parent2: String;
|
||||||
|
begin
|
||||||
|
ParentForm := GetParentForm(AControl, True);
|
||||||
|
if Assigned(ParentForm) then
|
||||||
|
Parent1 := ParentForm.Name
|
||||||
|
else
|
||||||
|
Parent1 := '';
|
||||||
|
|
||||||
|
Parent2 := '';
|
||||||
|
ParentAnchorDockLayoutTreeNode := TreeNodeControl;
|
||||||
|
while Assigned(ParentAnchorDockLayoutTreeNode.Parent) do begin
|
||||||
|
Parent2 := ParentAnchorDockLayoutTreeNode.Name;
|
||||||
|
ParentAnchorDockLayoutTreeNode := ParentAnchorDockLayoutTreeNode.Parent;
|
||||||
|
end;
|
||||||
|
Result := Parent1 = Parent2;
|
||||||
|
|
||||||
|
// DebugLn('TAnchorDockMaster.ParentsIdentical [', Parent1, '] [', Parent2, ']');
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
i:=ControlCount-1;
|
i:=ControlCount-1;
|
||||||
while i>=0 do begin
|
while i>=0 do begin
|
||||||
AControl:=Controls[i];
|
AControl:=Controls[i];
|
||||||
|
TreeNodeControl:=Tree.Root.FindChildNode(AControl.Name,true);
|
||||||
if DockedControlIsVisible(AControl)
|
if DockedControlIsVisible(AControl)
|
||||||
and (Tree.Root.FindChildNode(AControl.Name,true)=nil)
|
and (Application.MainForm<>AControl)
|
||||||
and (Application.MainForm<>AControl) then begin
|
and ((TreeNodeControl=nil) or not ParentsIdentical)
|
||||||
|
then begin
|
||||||
DisableControlAutoSizing(AControl);
|
DisableControlAutoSizing(AControl);
|
||||||
// AControl is currently on a visible site, but not in the Tree
|
// AControl is currently on a visible site, but not in the Tree
|
||||||
// => close site
|
// => close site
|
||||||
|
Loading…
Reference in New Issue
Block a user