mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 23:19:28 +02:00
LCL: control: fix design font PPI only if ParentFont=False
git-svn-id: trunk@54292 -
This commit is contained in:
parent
df06ce604d
commit
dec8fb4e29
@ -913,7 +913,8 @@ begin
|
||||
// be used for LCL HighDPI scaling.
|
||||
// Override this function - list all custom fonts in the overriden procedure
|
||||
|
||||
DoFixDesignFontPPI(Font, ADesignTimePPI);
|
||||
if not ParentFont then
|
||||
DoFixDesignFontPPI(Font, ADesignTimePPI);
|
||||
end;
|
||||
|
||||
procedure TControl.ExecuteCancelAction;
|
||||
|
@ -31,8 +31,17 @@ begin
|
||||
end;
|
||||
|
||||
procedure TCustomDesignControl.Loaded;
|
||||
var
|
||||
I: Integer;
|
||||
procedure FixChildren(const AParent: TWinControl);
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
for I := 0 to AParent.ControlCount-1 do
|
||||
begin
|
||||
AParent.Controls[I].FixDesignFontsPPI(FDesignTimePPI);
|
||||
if AParent.Controls[I] is TWinControl then
|
||||
FixChildren(TWinControl(AParent.Controls[I]));
|
||||
end;
|
||||
end;
|
||||
begin
|
||||
inherited Loaded;
|
||||
|
||||
@ -41,9 +50,7 @@ begin
|
||||
if Application.Scaled and Scaled then
|
||||
begin
|
||||
FixDesignFontsPPI(FDesignTimePPI);
|
||||
for I := 0 to ComponentCount-1 do
|
||||
if Components[I] is TControl then
|
||||
TControl(Components[I]).FixDesignFontsPPI(FDesignTimePPI);
|
||||
FixChildren(Self);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user