LCL: Increase distance between TToolButton icon and text in List mode.

This commit is contained in:
wp_xyz 2022-09-11 18:11:57 +02:00
parent 3952e9ce2d
commit 7db50f95cc
2 changed files with 7 additions and 2 deletions

View File

@ -2121,6 +2121,7 @@ type
cDefSeparatorWidth = 8;
cDefDividerWidth = 5;
cDefButtonDropDecArrowWidth = 2;
cIconTextDist = 5;
protected
FToolBar: TToolBar;
class procedure WSRegisterClass; override;

View File

@ -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