LCL: control: fix design font PPI only if ParentFont=False

git-svn-id: trunk@54292 -
This commit is contained in:
ondrej 2017-02-27 14:01:06 +00:00
parent df06ce604d
commit dec8fb4e29
2 changed files with 14 additions and 6 deletions

View File

@ -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;

View File

@ -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;