LCL: High-DPI: disable/enable auto sizing on scale.

git-svn-id: trunk@54359 -
This commit is contained in:
ondrej 2017-03-07 13:52:49 +00:00
parent ae7acd5803
commit 8537762cb8
3 changed files with 87 additions and 72 deletions

View File

@ -3008,6 +3008,8 @@ begin
// Apply the changes
if AMode in [lapAutoAdjustWithoutHorizontalScrolling, lapAutoAdjustForDPI] then
begin
DisableAutoSizing;
try
if not ParentFont or (Parent=nil) then
ScaleFontsPPI(AYProportion);
@ -3079,6 +3081,9 @@ begin
Constraints.AutoAdjustLayout(AXProportion, AYProportion);
SetBounds(NewLeft, NewTop, NewWidth, NewHeight);
finally
EnableAutoSizing;
end;
end;
end;

View File

@ -1581,6 +1581,8 @@ begin
// Apply the changes
if AMode in [lapAutoAdjustWithoutHorizontalScrolling, lapAutoAdjustForDPI] then
begin
DisableAutoSizing;
try
if not ParentFont or (Parent=nil) then
ScaleFontsPPI(AYProportion);
@ -1591,6 +1593,9 @@ begin
Constraints.AutoAdjustLayout(AXProportion, AYProportion);
SetBounds(Left, Top, NewWidth, NewHeight);
finally
EnableAutoSizing;
end;
end;
end;

View File

@ -3844,10 +3844,15 @@ procedure TWinControl.AutoAdjustLayout(AMode: TLayoutAdjustmentPolicy;
var
i: Integer;
begin
DisableAutoSizing;
try
for i:=0 to ControlCount-1 do
Controls[i].AutoAdjustLayout(AMode, AFromPPI, AToPPI, AOldFormWidth, ANewFormWidth);
inherited;
finally
EnableAutoSizing;
end;
end;
{------------------------------------------------------------------------------