diff --git a/components/spktoolbar/SpkGUITools/SpkGUITools.pas b/components/spktoolbar/SpkGUITools/SpkGUITools.pas index 8d7a13144..145042c97 100644 --- a/components/spktoolbar/SpkGUITools/SpkGUITools.pas +++ b/components/spktoolbar/SpkGUITools/SpkGUITools.pas @@ -387,7 +387,7 @@ end; implementation uses - LCLIntf, IntfGraphics, Math, Themes; + types, LCLIntf, IntfGraphics, Math, Themes; { TSpkGUITools } @@ -2909,16 +2909,21 @@ const var R: TRect; w: Integer; + sz: TSize; te: TThemedElementDetails; begin - w := GetSystemMetrics(SM_CYMENUCHECK); - R := Bounds(x, y, w, w); if ThemeServices.ThemesEnabled then begin te := ThemeServices.GetElementDetails(THEMED_FLAGS[AStyle, AState, ACheckboxState]); + sz := ThemeServices.GetDetailSize(te); + R := Bounds(x, y, sz.cx, sz.cy); + InflateRect(R, 1, 1); ThemeServices.DrawElement(ACanvas.Handle, te, R); - end else + end else begin + w := GetSystemMetrics(SM_CYMENUCHECK); + R := Bounds(x, y, w, w); DrawFrameControl( ACanvas.Handle, R, DFC_BUTTON, UNTHEMED_FLAGS[AStyle, AState]); + end; end; end. diff --git a/components/spktoolbar/SpkToolbar/spkt_Checkboxes.pas b/components/spktoolbar/SpkToolbar/spkt_Checkboxes.pas index a338d93cc..d3da53340 100644 --- a/components/spktoolbar/SpkToolbar/spkt_Checkboxes.pas +++ b/components/spktoolbar/SpkToolbar/spkt_Checkboxes.pas @@ -79,7 +79,7 @@ type implementation uses - LCLType, LCLIntf, Math, + LCLType, LCLIntf, Math, Themes, SpkGraphTools, spkt_Const, spkt_Tools, spkt_Pane; @@ -228,6 +228,7 @@ var FontColor: TColor; x, y: Integer; h: Integer; + te: TThemedElementDetails; begin if FToolbarDispatch = nil then exit; @@ -296,12 +297,16 @@ begin end; // Checkbox - h := GetSystemMetrics(SM_CYMENUCHECK); + if ThemeServices.ThemesEnabled then begin + te := ThemeServices.GetElementDetails(tbCheckboxCheckedNormal); + h := ThemeServices.GetDetailSize(te).cy; + end else + h := GetSystemMetrics(SM_CYMENUCHECK); if (FGroupBehaviour in [gbContinuesGroup, gbEndsGroup]) then x := FButtonRect.Left + SMALLBUTTON_HALF_BORDER_WIDTH + SMALLBUTTON_PADDING else x := FButtonRect.Left + SMALLBUTTON_BORDER_WIDTH + SMALLBUTTON_PADDING; - y := FButtonRect.top + (FButtonRect.height - h) div 2; + y := FButtonRect.Top + (FButtonRect.Height - h) div 2; TGUITools.DrawCheckbox( ABuffer.Canvas,