mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 04:58:11 +02:00
LCL: control: remove unnecessary GetScaledControlClassDefaultSize introduced in r58125 #3ec78f9640
git-svn-id: trunk@58135 -
This commit is contained in:
parent
9d88eeaf96
commit
640a3ed946
@ -1474,7 +1474,6 @@ type
|
||||
procedure DoContextPopup(MousePos: TPoint; var Handled: Boolean); virtual;
|
||||
procedure SetZOrder(TopMost: Boolean); virtual;
|
||||
class function GetControlClassDefaultSize: TSize; virtual;
|
||||
function GetScaledControlClassDefaultSize: TSize;
|
||||
function ColorIsStored: boolean; virtual;
|
||||
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
|
||||
const AXProportion, AYProportion: Double); virtual;
|
||||
|
@ -1409,13 +1409,6 @@ begin
|
||||
Result := ColorToRGB(GetColorResolvingParent());
|
||||
end;
|
||||
|
||||
function TControl.GetScaledControlClassDefaultSize: TSize;
|
||||
begin
|
||||
Result := GetControlClassDefaultSize;
|
||||
Result.cx := Scale96ToFont(Result.cx);
|
||||
Result.cy := Scale96ToFont(Result.cy);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
TControl.DoConstrainedResize
|
||||
------------------------------------------------------------------------------}
|
||||
@ -5577,14 +5570,14 @@ function TControl.GetDefaultWidth: integer;
|
||||
begin
|
||||
if WidthIsAnchored then
|
||||
// if width is anchored the read and base bounds were changed at designtime
|
||||
Result := GetScaledControlClassDefaultSize.cx
|
||||
Result := Scale96ToFont(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 := GetScaledControlClassDefaultSize.cx;
|
||||
Result := Scale96ToFont(GetControlClassDefaultSize.cx);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -5597,14 +5590,14 @@ function TControl.GetDefaultHeight: integer;
|
||||
begin
|
||||
if HeightIsAnchored then
|
||||
// if height is anchored the read and base bounds were changed at designtime
|
||||
Result := GetScaledControlClassDefaultSize.cy
|
||||
Result := Scale96ToFont(GetControlClassDefaultSize.cy)
|
||||
else if cfBaseBoundsValid in FControlFlags then
|
||||
Result := BaseBounds.Bottom - BaseBounds.Top
|
||||
else
|
||||
if cfHeightLoaded in FControlFlags then
|
||||
Result := FReadBounds.Bottom - FReadBounds.Top
|
||||
else
|
||||
Result := GetScaledControlClassDefaultSize.cy;
|
||||
Result := Scale96ToFont(GetControlClassDefaultSize.cy);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -1431,10 +1431,10 @@ begin
|
||||
// if no preferred size is valid use the class defaults
|
||||
if not IsPrefWidthValid then
|
||||
PreferredSize[asboHorizontal]:=
|
||||
Control.Constraints.MinMaxWidth(Control.GetScaledControlClassDefaultSize.CX);
|
||||
Control.Constraints.MinMaxWidth(Control.Scale96ToFont(Control.GetControlClassDefaultSize.CX));
|
||||
if not IsPrefHeightValid then
|
||||
PreferredSize[asboVertical]:=
|
||||
Control.Constraints.MinMaxHeight(Control.GetScaledControlClassDefaultSize.CY);
|
||||
Control.Constraints.MinMaxHeight(Control.Scale96ToFont(Control.GetControlClassDefaultSize.CY));
|
||||
|
||||
//DebugLn(['TAutoSizeBox.SetControl ',DbgSName(Control),' ',PreferredSize[asboHorizontal]]);
|
||||
Control.BorderSpacing.GetSpaceAround(Border);
|
||||
|
Loading…
Reference in New Issue
Block a user