From 5e350b0270cd6705d8678b10c78a407a1903ca75 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Tue, 23 Nov 2021 18:09:36 +0000 Subject: [PATCH] exctrls/exquestiondlg: Parameterize some distances and make them high-dpi aware. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8156 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/exctrls/source/exquestiondlg.pas | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/exctrls/source/exquestiondlg.pas b/components/exctrls/source/exquestiondlg.pas index 2c49fe72c..1494e1234 100644 --- a/components/exctrls/source/exquestiondlg.pas +++ b/components/exctrls/source/exquestiondlg.pas @@ -67,10 +67,13 @@ uses TypInfo, Math; const + DEFAULT_IMAGE_SIZE = 32; DEFAULT_IMAGE_BORDER_X = 10; DEFAULT_IMAGE_BORDER_Y = 5; DEFAULT_TEXT_BORDER_X = 10; DEFAULT_TEXT_BORDER_Y = 10; + BUTTON_MIN_WIDTH = 75; + BUTTON_SPACING = 6; function GetBKType(str:string):TBitBtnKind; var @@ -192,12 +195,12 @@ begin btn.OnClick := @HelpClickHandler; if trim(btnParams[i].Caption) <> '' then btn.Caption := btnParams[i].Caption; - btn.Constraints.MinWidth := 75; + btn.Constraints.MinWidth := Scale96ToFont(BUTTON_MIN_WIDTH); btn.Cancel := (btnParams[i].IsDefaultOrCancel = 2); btn.Default := (btnParams[i].IsDefaultOrCancel = 1); if btn.Default then ActiveControl := btn; btn.AutoSize := true; - btn.BorderSpacing.Around := 6; + btn.BorderSpacing.Around := Scale96ToFont(BUTTON_SPACING); if i = 0 then btn.AnchorSideLeft.Control := FInnerButtonPanel else @@ -358,7 +361,7 @@ begin if Assigned(FImage) then imgHeight := FImage.Height else - imgHeight := 32; + imgHeight := Scale96ToFont(DEFAULT_IMAGE_SIZE); if (AHeight < 2*FImageBorder.CY + imgHeight) then AHeight := 2*FImageBorder.CY + imgHeight; if AHeight < QuestionDlgEx_MinHeight then