diff --git a/components/datetimectrls/datetimepicker.pas b/components/datetimectrls/datetimepicker.pas index d12deb5395..5ed0bc897f 100644 --- a/components/datetimectrls/datetimepicker.pas +++ b/components/datetimectrls/datetimepicker.pas @@ -2040,12 +2040,9 @@ function TCustomDateTimePicker.GetCheckBoxRect(IgnoreRightToLeft: Boolean): TRec var Details: TThemedElementDetails; CSize: TSize; - begin Details := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal); CSize := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch); - CSize.cx := ScaleScreenToFont(CSize.cx); - CSize.cy := ScaleScreenToFont(CSize.cy); if IsRightToLeft and not IgnoreRightToLeft then begin Result.Right := ClientWidth - (BorderSpacing.InnerBorder + BorderWidth); @@ -2062,10 +2059,8 @@ end; --------------- Returns upper left corner of the rectangle where the text is written. Also used in calculating our preferred size. } -function TCustomDateTimePicker.GetTextOrigin(IgnoreRightToLeft: Boolean - ): TPoint; - -var +function TCustomDateTimePicker.GetTextOrigin(IgnoreRightToLeft: Boolean): TPoint; +var Re: TRect; B: Integer; XL, XR: Integer; @@ -3105,6 +3100,7 @@ var S: String; const + // Enabled, Checked, Mouse hover CheckStates: array[Boolean, Boolean, Boolean] of TThemedButton = ( ((tbCheckBoxUncheckedDisabled, tbCheckBoxUncheckedDisabled), (tbCheckBoxCheckedDisabled, tbCheckBoxCheckedDisabled)), diff --git a/components/ideintf/objectinspector.pp b/components/ideintf/objectinspector.pp index 3037379163..0627802819 100644 --- a/components/ideintf/objectinspector.pp +++ b/components/ideintf/objectinspector.pp @@ -2398,8 +2398,8 @@ begin ExpandRow(Index); end; end; - // WasValueClick param is only for Boolean checkboxes, toggled if user - // clicks the square. It has no effect for Boolean ComboBox editor. + // WasValueClick param for SetItemIndexAndFocus is only for Boolean checkboxes, + // toggled if user clicks the square. It has no effect for Boolean ComboBox editor. Details := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal); Sz := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch); SetItemIndexAndFocus(Index, (X>SplitterX) and (X<=SplitterX+Sz.cx)); diff --git a/components/lazreport/source/addons/DialogControls/lrdialogcontrols.pas b/components/lazreport/source/addons/DialogControls/lrdialogcontrols.pas index 9853ca844c..5dc1b09629 100644 --- a/components/lazreport/source/addons/DialogControls/lrdialogcontrols.pas +++ b/components/lazreport/source/addons/DialogControls/lrdialogcontrols.pas @@ -519,7 +519,8 @@ begin Details := ThemeServices.GetElementDetails(tbRadioButtonUncheckedNormal); details_chek:=ThemeServices.GetElementDetails(tbRadioButtonCheckedNormal); - CSize := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch); + // Maybe: CSize := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch); + CSize := ThemeServices.GetDetailSize(Details); while (AY < DRect.Bottom) and (i0 then // theme services support sorted arrows @@ -4839,7 +4839,8 @@ begin end else begin Details := ThemeServices.GetElementDetails(arrtb[AState]); - CSize := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch); + // Maybe: CSize := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch); + CSize := ThemeServices.GetDetailSize(Details); CSize.cx := MulDiv(CSize.cx, Font.PixelsPerInch, Screen.PixelsPerInch); CSize.cy := MulDiv(CSize.cy, Font.PixelsPerInch, Screen.PixelsPerInch); end; diff --git a/lcl/include/toolbar.inc b/lcl/include/toolbar.inc index c31cf6e635..706ee1e054 100644 --- a/lcl/include/toolbar.inc +++ b/lcl/include/toolbar.inc @@ -89,10 +89,11 @@ begin csDoubleClicks, csMenuEvents, csSetCaption, csParentBackground, csOpaque]; FFlat := True; Height := 32; + // ToDo: Test the scaling code. Widths are scaled in many places. Details := ThemeServices.GetElementDetails(ttbSplitButtonDropDownNormal); - FThemeDropDownWidth := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch).cx; + FThemeDropDownWidth := ThemeServices.GetDetailSize(Details).cx; Details := ThemeServices.GetElementDetails(ttbDropDownButtonNormal); - FThemeButtonDropWidth := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch).cx; + FThemeButtonDropWidth := ThemeServices.GetDetailSize(Details).cx; FButtonHeight := -1; FButtonWidth := -1; FDropDownWidth := -1; diff --git a/packager/interpkgconflictfiles.pas b/packager/interpkgconflictfiles.pas index 84d73775e3..4a14292c24 100644 --- a/packager/interpkgconflictfiles.pas +++ b/packager/interpkgconflictfiles.pas @@ -241,7 +241,8 @@ begin else Detail := tbCheckBoxUncheckedNormal; Details := ThemeServices.GetElementDetails(Detail); - aSize := ThemeServices.GetDetailSizeForPPI(Details, PixelsPerInch); + // Maybe: aSize := ThemeServices.GetDetailSizeForPPI(Details, PixelsPerInch); + aSize := ThemeServices.GetDetailSize(Details); NodeRect:=Node.DisplayRect(false); r:=Bounds(Node.DisplayIconLeft+(ImageList1.Width-aSize.cx) div 2, NodeRect.Top+(NodeRect.Bottom-NodeRect.Top-aSize.cy) div 2, @@ -392,7 +393,8 @@ begin ButtonPanel1.OKButton.OnClick:=@OkButtonClick; Details := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal); - aSize := ThemeServices.GetDetailSizeForPPI(Details, PixelsPerInch); + // Maybe: aSize := ThemeServices.GetDetailSizeForPPI(Details, PixelsPerInch); + aSize := ThemeServices.GetDetailSize(Details); ImageList1.Width:=Max(16,aSize.cx); ImageList1.Height:=Max(16,aSize.cy); // add empty images