mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 20:21:04 +02:00
anchordocking: Resize: use current bounds not preferred bounds, the anchordocksite is not autosized
git-svn-id: trunk@27928 -
This commit is contained in:
parent
7d0234c10c
commit
38df7bec96
@ -2181,7 +2181,7 @@ begin
|
|||||||
RestoreLayouts.LoadFromConfig(Config);
|
RestoreLayouts.LoadFromConfig(Config);
|
||||||
Config.UndoAppendBasePath;
|
Config.UndoAppendBasePath;
|
||||||
|
|
||||||
WriteDebugLayout('TAnchorDockMaster.LoadLayoutFromConfig ',Tree.Root);
|
//WriteDebugLayout('TAnchorDockMaster.LoadLayoutFromConfig ',Tree.Root);
|
||||||
//DebugWriteChildAnchors(Tree.Root);
|
//DebugWriteChildAnchors(Tree.Root);
|
||||||
|
|
||||||
// close all unneeded forms/controls
|
// close all unneeded forms/controls
|
||||||
@ -4906,6 +4906,7 @@ begin
|
|||||||
else if AControl is TAnchorDockSplitter then
|
else if AControl is TAnchorDockSplitter then
|
||||||
b:=TAnchorDockSplitter(AControl).DockRestoreBounds;
|
b:=TAnchorDockSplitter(AControl).DockRestoreBounds;
|
||||||
if (b.Right>b.Left) and (b.Bottom>b.Top) then begin
|
if (b.Right>b.Left) and (b.Bottom>b.Top) then begin
|
||||||
|
//debugln(['TAnchorDockManager.ResetBounds RESTORE ',DbgSName(AControl),' Cur=',dbgs(AControl.BoundsRect),' Restore=',dbgs(b)]);
|
||||||
AControl.BoundsRect:=b;
|
AControl.BoundsRect:=b;
|
||||||
if AControl is TAnchorDockSplitter then
|
if AControl is TAnchorDockSplitter then
|
||||||
TAnchorDockSplitter(AControl).UpdateDockBounds;
|
TAnchorDockSplitter(AControl).UpdateDockBounds;
|
||||||
@ -4928,7 +4929,7 @@ begin
|
|||||||
end else begin
|
end else begin
|
||||||
ChildMaxSize.Y:=Max(0,(ChildMaxSize.Y-SiteMinSize.Y));
|
ChildMaxSize.Y:=Max(0,(ChildMaxSize.Y-SiteMinSize.Y));
|
||||||
end;
|
end;
|
||||||
debugln(['TAnchorDockManager.ResetBounds ChildMaxSize=',dbgs(ChildMaxSize),' SiteMinSize=',dbgs(SiteMinSize)]);
|
debugln(['TAnchorDockManager.ResetBounds ChildMaxSize=',dbgs(ChildMaxSize),' SiteMinSize=',dbgs(SiteMinSize),' Site.Client=',dbgs(Site.ClientRect)]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
case ResizePolicy of
|
case ResizePolicy of
|
||||||
@ -4936,8 +4937,11 @@ begin
|
|||||||
begin
|
begin
|
||||||
if Child.Align in [alLeft,alRight] then
|
if Child.Align in [alLeft,alRight] then
|
||||||
Child.Width:=Max(1,Min(ChildMaxSize.X,Child.Width+WidthDiff))
|
Child.Width:=Max(1,Min(ChildMaxSize.X,Child.Width+WidthDiff))
|
||||||
else
|
else begin
|
||||||
Child.Height:=Max(1,Min(ChildMaxSize.Y,Child.Height+HeightDiff));
|
i:=Max(1,Min(ChildMaxSize.Y,Child.Height+HeightDiff));
|
||||||
|
//debugln(['TAnchorDockManager.ResetBounds Child=',DbgSName(Child),' OldHeight=',Child.Height,' NewHeight=',i]);
|
||||||
|
Child.Height:=i;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -5055,7 +5059,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TAnchorDockManager.GetSitePreferredClientSize: TPoint;
|
function TAnchorDockManager.GetSitePreferredClientSize: TPoint;
|
||||||
{ Compute the preferred inner size of Site without the ChildSite
|
{ Compute the preferred inner size of Site without the ChildSite and without
|
||||||
|
the splitter
|
||||||
}
|
}
|
||||||
var
|
var
|
||||||
ChildSite: TAnchorDockHostSite;
|
ChildSite: TAnchorDockHostSite;
|
||||||
@ -5066,11 +5071,11 @@ begin
|
|||||||
Site.GetPreferredSize(Result.X,Result.Y);
|
Site.GetPreferredSize(Result.X,Result.Y);
|
||||||
ChildSite:=GetChildSite;
|
ChildSite:=GetChildSite;
|
||||||
if ChildSite<>nil then begin
|
if ChildSite<>nil then begin
|
||||||
ChildSitePrefSize:=Point(0,0);
|
// subtract the ChildSite and the splitter
|
||||||
ChildSite.GetPreferredSize(ChildSitePrefSize.X,ChildSitePrefSize.Y,true);
|
|
||||||
SplitterSize:=Point(0,0);
|
SplitterSize:=Point(0,0);
|
||||||
if ChildSite.BoundSplitter<>nil then
|
if ChildSite.BoundSplitter<>nil then
|
||||||
ChildSite.BoundSplitter.GetPreferredSize(SplitterSize.X,SplitterSize.Y);
|
ChildSite.BoundSplitter.GetPreferredSize(SplitterSize.X,SplitterSize.Y);
|
||||||
|
ChildSitePrefSize:=Point(ChildSite.Width,ChildSite.Height);
|
||||||
debugln(['TAnchorDockManager.GetSitePreferredClientSize Total=',dbgs(Result),' Child=',dbgs(ChildSitePrefSize),' Splitter=',dbgs(SplitterSize)]);
|
debugln(['TAnchorDockManager.GetSitePreferredClientSize Total=',dbgs(Result),' Child=',dbgs(ChildSitePrefSize),' Splitter=',dbgs(SplitterSize)]);
|
||||||
if ChildSite.Align in [alLeft,alRight] then begin
|
if ChildSite.Align in [alLeft,alRight] then begin
|
||||||
Result.X:=Max(0,Result.X-ChildSitePrefSize.X-SplitterSize.X);
|
Result.X:=Max(0,Result.X-ChildSitePrefSize.X-SplitterSize.X);
|
||||||
|
@ -287,6 +287,7 @@ begin
|
|||||||
DockMaster.LoadLayoutFromConfig(Config,true);
|
DockMaster.LoadLayoutFromConfig(Config,true);
|
||||||
UserLayoutLoaded:=true;
|
UserLayoutLoaded:=true;
|
||||||
end else begin
|
end else begin
|
||||||
|
debugln(['TIDEAnchorDockMaster.LoadUserLayout loading default layout ...']);
|
||||||
LoadDefaultLayout;
|
LoadDefaultLayout;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
@ -326,6 +327,7 @@ var
|
|||||||
XMLConfig: TXMLConfig;
|
XMLConfig: TXMLConfig;
|
||||||
Config: TXMLConfigStorage;
|
Config: TXMLConfigStorage;
|
||||||
begin
|
begin
|
||||||
|
//debugln(['TIDEAnchorDockMaster.LoadLayoutFromFile ',Filename]);
|
||||||
XMLConfig:=TXMLConfig.Create(nil);
|
XMLConfig:=TXMLConfig.Create(nil);
|
||||||
try
|
try
|
||||||
XMLConfig.Filename:=Filename;
|
XMLConfig.Filename:=Filename;
|
||||||
|
Loading…
Reference in New Issue
Block a user