mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 06:56:10 +02:00
AnchorDocking: Revert revision 54525 #6139a22bcf as it breaks other reloading of AnchorDocking layouts. Issue #31834
git-svn-id: trunk@55083 -
This commit is contained in:
parent
aa236dd4a5
commit
95d8fc70ee
@ -1465,40 +1465,13 @@ function TAnchorDockMaster.CloseUnneededControls(Tree: TAnchorDockLayoutTree
|
||||
var
|
||||
i: Integer;
|
||||
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
|
||||
i:=ControlCount-1;
|
||||
while i>=0 do begin
|
||||
AControl:=Controls[i];
|
||||
TreeNodeControl:=Tree.Root.FindChildNode(AControl.Name,true);
|
||||
if DockedControlIsVisible(AControl)
|
||||
and (Application.MainForm<>AControl)
|
||||
and ((TreeNodeControl=nil) or not ParentsIdentical)
|
||||
then begin
|
||||
and (Tree.Root.FindChildNode(AControl.Name,true)=nil)
|
||||
and (Application.MainForm<>AControl) then begin
|
||||
DisableControlAutoSizing(AControl);
|
||||
// AControl is currently on a visible site, but not in the Tree
|
||||
// => close site
|
||||
|
Loading…
Reference in New Issue
Block a user