mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-16 02:40:36 +01:00
LCL/MessageDlg: Fix too-high buttons created by CreateMessageDlg in case of high-dpi. Issue #0032704.
git-svn-id: trunk@64673 -
This commit is contained in:
parent
06eb834614
commit
aea537a7ec
@ -277,7 +277,19 @@ var
|
||||
function GetButtonSize(AButton: TBitBtn): TPoint;
|
||||
begin
|
||||
AButton.HandleNeeded;
|
||||
|
||||
// Issue 32704: Fix button size at high dpi
|
||||
// CalcPreferredSize uses the real font size although the button's
|
||||
// Font.PixelsPerInch is still at 96ppi here.
|
||||
// Because the general LCL scaling procedure, AutoAdjustLayout, will
|
||||
// later scale the button size again, we must scale the output of
|
||||
// GetPreferredSize down to 96 ppi here.
|
||||
AButton.Font.PixelsPerInch := Monitor.PixelsPerInch;
|
||||
TBitBtnAccess(AButton).CalculatePreferredSize(Result.x, Result.y, True);
|
||||
Result.x := AButton.ScaleFontTo96(Result.x);
|
||||
Result.y := AButton.ScaleFontTo96(Result.y);
|
||||
AButton.Font.PixelsPerInch := 96;
|
||||
|
||||
if MinBtnHeight < Result.y then
|
||||
MinBtnHeight := Result.y
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user