mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 19:09:19 +02:00
LCL: AutoSize=true, no childs, no content, consider AdjustClientRect
git-svn-id: trunk@24442 -
This commit is contained in:
parent
d00e912de8
commit
c88de91a79
@ -7797,7 +7797,17 @@ begin
|
||||
inc(PreferredHeight,BorderSpacing.InnerBorder*2);
|
||||
end;
|
||||
|
||||
// check AdjustClientRect
|
||||
CurClientRect:=Rect(0,0,1000,1000);
|
||||
AdjustedClientRect:=CurClientRect;
|
||||
AdjustClientRect(AdjustedClientRect);
|
||||
PreferredWidth:=Max(PreferredWidth,
|
||||
AdjustedClientRect.Left+CurClientRect.Right-AdjustedClientRect.Right);
|
||||
PreferredHeight:=Max(PreferredHeight,
|
||||
AdjustedClientRect.Top+CurClientRect.Bottom-AdjustedClientRect.Bottom);
|
||||
|
||||
if ControlCount>0 then begin
|
||||
// Beware: ControlCount>0 does not mean that there are visible childs
|
||||
|
||||
// get the size requirements for the child controls
|
||||
Layout:=nil;
|
||||
@ -7824,15 +7834,6 @@ begin
|
||||
{$ENDIF}
|
||||
PreferredWidth:=Max(PreferredWidth,NewWidth);
|
||||
PreferredHeight:=Max(PreferredHeight,NewHeight);
|
||||
end else begin
|
||||
// check AdjustClientRect
|
||||
CurClientRect:=Rect(0,0,1000,1000);
|
||||
AdjustedClientRect:=CurClientRect;
|
||||
AdjustClientRect(AdjustedClientRect);
|
||||
PreferredWidth:=Max(PreferredWidth,
|
||||
AdjustedClientRect.Left+CurClientRect.Right-AdjustedClientRect.Right);
|
||||
PreferredHeight:=Max(PreferredHeight,
|
||||
AdjustedClientRect.Top+CurClientRect.Bottom-AdjustedClientRect.Bottom);
|
||||
end;
|
||||
{$IFDEF VerboseAutoSize}
|
||||
debugln('TWinControl.CalculatePreferredSize ',DbgSName(Self),
|
||||
|
Loading…
Reference in New Issue
Block a user