From 7db50f95cc41a467762906bc20598cfc8b5586a9 Mon Sep 17 00:00:00 2001 From: wp_xyz Date: Sun, 11 Sep 2022 18:11:57 +0200 Subject: [PATCH] LCL: Increase distance between TToolButton icon and text in List mode. --- lcl/comctrls.pp | 1 + lcl/include/toolbutton.inc | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lcl/comctrls.pp b/lcl/comctrls.pp index 03968d837b..13f7ddb8bc 100644 --- a/lcl/comctrls.pp +++ b/lcl/comctrls.pp @@ -2121,6 +2121,7 @@ type cDefSeparatorWidth = 8; cDefDividerWidth = 5; cDefButtonDropDecArrowWidth = 2; + cIconTextDist = 5; protected FToolBar: TToolBar; class procedure WSRegisterClass; override; diff --git a/lcl/include/toolbutton.inc b/lcl/include/toolbutton.inc index fc947d26c3..bf1bbba824 100644 --- a/lcl/include/toolbutton.inc +++ b/lcl/include/toolbutton.inc @@ -295,6 +295,7 @@ var DropDownButtonRect: TRect; TextSize: TSize; TextPos: TPoint; + dist: Integer; IconSize: TSize; IconPos: TPoint; ImgList: TCustomImageList; @@ -372,9 +373,10 @@ begin if FToolBar.List then begin // icon left of text + dist := FToolbar.Scale96ToFont(cIconTextDist); IconPos.X:=(MainBtnRect.Left+MainBtnRect.Right-IconSize.cx-TextSize.cx-2) div 2; IconPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-IconSize.cy) div 2; - TextPos.X:=IconPos.X+IconSize.cx+2; + TextPos.X:=IconPos.X+IconSize.cx+dist; TextPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-TextSize.cy) div 2; end else begin @@ -1126,6 +1128,7 @@ var TextSize: TSize; TextPos: TPoint; IconPos: TPoint; + dist: Integer; ImgList: TCustomImageList; ImgIndex: integer; ImgEffect: TGraphicsDrawEffect; @@ -1173,7 +1176,8 @@ begin if FToolBar.List then begin // icon left of text - TextPos.X := IconPos.X + IconSize.cx + 2; + dist := FToolbar.Scale96ToFont(cIconTextDist); + TextPos.X := IconPos.X + IconSize.cx + dist; end else begin