LCL: HighDPI: check Application.Scaled for auto-scaling

git-svn-id: trunk@54260 -
This commit is contained in:
ondrej 2017-02-24 12:07:07 +00:00
parent a0b00a6d66
commit d79fd99a1e
2 changed files with 4 additions and 4 deletions

View File

@ -511,7 +511,7 @@ begin
Exit;
end;
if PixelsPerInch<>Monitor.PixelsPerInch then
if Application.Scaled and (PixelsPerInch<>Monitor.PixelsPerInch) then
AutoAdjustLayout(lapAutoAdjustForDPI, PixelsPerInch, Monitor.PixelsPerInch,
MulDiv(Width, Monitor.PixelsPerInch, PixelsPerInch),
MulDiv(Height, Monitor.PixelsPerInch, PixelsPerInch));
@ -2293,7 +2293,7 @@ begin
if Parent=nil then
begin
NewDpi := hi(Msg.wParam);
if Scaled and (NewDpi<>PixelsPerInch) then
if Application.Scaled and Scaled and (NewDpi<>PixelsPerInch) then
AutoAdjustLayout(lapAutoAdjustForDPI, PixelsPerInch, NewDpi,
Width, MulDiv(Width, NewDpi, PixelsPerInch));
end;
@ -2312,7 +2312,7 @@ end;
------------------------------------------------------------------------------}
procedure TCustomForm.Show;
begin
if Scaled and (Monitor.PixelsPerInch<>PixelsPerInch) then
if Application.Scaled and Scaled and (Monitor.PixelsPerInch<>PixelsPerInch) then
AutoAdjustLayout(lapAutoAdjustForDPI, PixelsPerInch, Monitor.PixelsPerInch,
Width, MulDiv(Width, Monitor.PixelsPerInch, PixelsPerInch));

View File

@ -131,7 +131,7 @@ begin
UpdateActionLists(Self,opInsert);
ParentForm := GetParentForm(Self);
if (ParentForm<>nil) and ParentForm.Scaled
if Application.Scaled and (ParentForm<>nil) and ParentForm.Scaled
and (ParentForm.PixelsPerInch<>PixelsPerInch) then
AutoAdjustLayout(lapAutoAdjustForDPI, PixelsPerInch, ParentForm.PixelsPerInch, 0, 0);
end;