mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 19:20:12 +02:00
lcl: forms: scale TFrame the same as TForm. Issue #31807
git-svn-id: trunk@54898 -
This commit is contained in:
parent
51b03efe92
commit
96886b5551
@ -267,6 +267,8 @@ type
|
||||
|
||||
procedure AutoAdjustLayout(AMode: TLayoutAdjustmentPolicy; const AFromPPI,
|
||||
AToPPI, AOldFormWidth, ANewFormWidth: Integer); override;
|
||||
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
|
||||
const AXProportion, AYProportion: Double); override;
|
||||
procedure Loaded; override;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
@ -547,8 +549,6 @@ type
|
||||
procedure CreateParams(var Params: TCreateParams); override;
|
||||
procedure CreateWnd; override;
|
||||
procedure Deactivate; virtual;
|
||||
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
|
||||
const AXProportion, AYProportion: Double); override;
|
||||
procedure DoClose(var CloseAction: TCloseAction); virtual;
|
||||
procedure DoCreate; virtual;
|
||||
procedure DoDestroy; virtual;
|
||||
|
@ -30,6 +30,39 @@ begin
|
||||
FPixelsPerInch := AToPPI;
|
||||
end;
|
||||
|
||||
procedure TCustomDesignControl.DoAutoAdjustLayout(
|
||||
const AMode: TLayoutAdjustmentPolicy; const AXProportion, AYProportion: Double
|
||||
);
|
||||
var
|
||||
NewWidth, NewHeight: Integer;
|
||||
begin
|
||||
if Assigned(Parent) then
|
||||
begin
|
||||
inherited;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
// Apply the changes
|
||||
if AMode in [lapAutoAdjustWithoutHorizontalScrolling, lapAutoAdjustForDPI] then
|
||||
begin
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomForm.DoAutoAdjustLayout'){$ENDIF};
|
||||
try
|
||||
if not ParentFont or (Parent=nil) then
|
||||
ScaleFontsPPI(AYProportion);
|
||||
|
||||
NewWidth := Round(Width*AXProportion);
|
||||
NewHeight := Round(Height*AYProportion);
|
||||
|
||||
BorderSpacing.AutoAdjustLayout(AXProportion, AYProportion);
|
||||
Constraints.AutoAdjustLayout(AXProportion, AYProportion);
|
||||
|
||||
SetBounds(Left, Top, NewWidth, NewHeight);
|
||||
finally
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomForm.DoAutoAdjustLayout'){$ENDIF};
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomDesignControl.Loaded;
|
||||
procedure FixChildren(const AParent: TWinControl);
|
||||
var
|
||||
|
@ -1560,38 +1560,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomForm.DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
|
||||
const AXProportion, AYProportion: Double);
|
||||
var
|
||||
NewWidth, NewHeight: Integer;
|
||||
begin
|
||||
if Assigned(Parent) then
|
||||
begin
|
||||
inherited;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
// Apply the changes
|
||||
if AMode in [lapAutoAdjustWithoutHorizontalScrolling, lapAutoAdjustForDPI] then
|
||||
begin
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomForm.DoAutoAdjustLayout'){$ENDIF};
|
||||
try
|
||||
if not ParentFont or (Parent=nil) then
|
||||
ScaleFontsPPI(AYProportion);
|
||||
|
||||
NewWidth := Round(Width*AXProportion);
|
||||
NewHeight := Round(Height*AYProportion);
|
||||
|
||||
BorderSpacing.AutoAdjustLayout(AXProportion, AYProportion);
|
||||
Constraints.AutoAdjustLayout(AXProportion, AYProportion);
|
||||
|
||||
SetBounds(Left, Top, NewWidth, NewHeight);
|
||||
finally
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomForm.DoAutoAdjustLayout'){$ENDIF};
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomForm.DoRemoveActionList(List: TCustomActionList);
|
||||
begin
|
||||
if FActionLists<>nil then
|
||||
|
Loading…
Reference in New Issue
Block a user