mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 18:29:12 +02:00
LCL: computing preferred clientrect: fixed to use Child.GetDefaultWidth/Height and fixed GetDefaultWidth/Height to use BaseBounds only if size is fixed
git-svn-id: trunk@26451 -
This commit is contained in:
parent
cfda21de52
commit
70b09d3d69
@ -4612,13 +4612,15 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TControl.GetDefaultWidth: integer;
|
||||
begin
|
||||
if cfBaseBoundsValid in FControlFlags then
|
||||
if AutoSize or WidthIsAnchored then
|
||||
Result := GetControlClassDefaultSize.cx
|
||||
else if cfBaseBoundsValid in FControlFlags then
|
||||
Result := FBaseBounds.Right - FBaseBounds.Left
|
||||
else
|
||||
if cfWidthLoaded in FControlFlags then
|
||||
Result := FReadBounds.Right - FReadBounds.Left
|
||||
else
|
||||
Result := GetControlClassDefaultSize.CX;
|
||||
Result := GetControlClassDefaultSize.cx;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -4629,7 +4631,9 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TControl.GetDefaultHeight: integer;
|
||||
begin
|
||||
if cfBaseBoundsValid in FControlFlags then
|
||||
if AutoSize or HeightIsAnchored then
|
||||
Result := GetControlClassDefaultSize.cy
|
||||
else if cfBaseBoundsValid in FControlFlags then
|
||||
Result := BaseBounds.Bottom - BaseBounds.Top
|
||||
else
|
||||
if cfHeightLoaded in FControlFlags then
|
||||
|
@ -1038,7 +1038,7 @@ procedure TAutoSizeCtrlData.ComputePreferredClientArea(
|
||||
or ((CurPreferredWidth=0) and (csAutoSize0x0 in Child.ControlStyle)) then
|
||||
NewWidth:=CurPreferredWidth
|
||||
else
|
||||
NewWidth:=Max(1,Child.GetControlClassDefaultSize.cx);
|
||||
NewWidth:=Max(1,Child.GetDefaultWidth);
|
||||
NewWidth:=Child.Constraints.MinMaxWidth(NewWidth);
|
||||
|
||||
if UseCurrentHeight then
|
||||
@ -1047,7 +1047,7 @@ procedure TAutoSizeCtrlData.ComputePreferredClientArea(
|
||||
or ((CurPreferredHeight=0) and (csAutoSize0x0 in Child.ControlStyle)) then
|
||||
NewHeight:=CurPreferredHeight
|
||||
else
|
||||
NewHeight:=Max(1,Child.GetControlClassDefaultSize.cy);
|
||||
NewHeight:=Max(1,Child.GetDefaultHeight);
|
||||
NewHeight:=Child.Constraints.MinMaxHeight(NewHeight);
|
||||
end else begin
|
||||
NewWidth:=0;
|
||||
|
Loading…
Reference in New Issue
Block a user