grids: scale native bitmaps. Issue #31771

ide: buildmodesmanager dialog: high-DPI check boxes. Issue #31771

git-svn-id: trunk@54918 -
This commit is contained in:
ondrej 2017-05-14 10:04:10 +00:00
parent 68fbe369e0
commit db2a57aa2c
2 changed files with 4 additions and 1 deletions

View File

@ -12,7 +12,7 @@ object BuildModesForm: TBuildModesForm
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '1.7'
LCLVersion = '1.9.0.0'
object ButtonPanel1: TButtonPanel
Left = 6
Height = 32
@ -147,6 +147,7 @@ object BuildModesForm: TBuildModesForm
FixedCols = 0
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goRowSelect, goThumbTracking, goSmoothScroll]
TabOrder = 1
TitleStyle = tsNative
OnCheckboxToggled = BuildModesCheckboxToggled
OnDrawCell = BuildModesStringGridDrawCell
OnSelection = BuildModesStringGridSelection

View File

@ -4439,6 +4439,8 @@ begin
if (TitleStyle=tsNative) and not assigned(OnUserCheckboxBitmap) then begin
Details := ThemeServices.GetElementDetails(arrtb[AState]);
CSize := ThemeServices.GetDetailSize(Details);
CSize.cx := MulDiv(CSize.cx, Font.PixelsPerInch, Screen.PixelsPerInch);
CSize.cy := MulDiv(CSize.cy, Font.PixelsPerInch, Screen.PixelsPerInch);
case bmpAlign of
taCenter: PaintRect.Left := Trunc((aRect.Left + aRect.Right - CSize.cx)/2);
taLeftJustify: PaintRect.Left := ARect.Left + constCellPadding;