LCL: TToolButton: use current ButtonWidth/Height as minimum, bug #17356

git-svn-id: trunk@27938 -
This commit is contained in:
mattias 2010-10-29 07:28:38 +00:00
parent 64f66bd4d7
commit 964a482d5f

View File

@ -934,7 +934,6 @@ var
TextSize: TSize; TextSize: TSize;
TextPos: TPoint; TextPos: TPoint;
IconPos: TPoint; IconPos: TPoint;
DefSize: TSize;
ImgList: TCustomImageList; ImgList: TCustomImageList;
ImgIndex: integer; ImgIndex: integer;
begin begin
@ -999,9 +998,8 @@ begin
begin begin
inc(PreferredWidth, 4); inc(PreferredWidth, 4);
inc(PreferredHeight, 4); inc(PreferredHeight, 4);
DefSize := GetControlClassDefaultSize; PreferredWidth := Max(PreferredWidth, FToolBar.ButtonWidth);
PreferredWidth := Max(PreferredWidth, DefSize.CX); PreferredHeight := Max(PreferredHeight, FToolBar.ButtonHeight);
PreferredHeight := Max(PreferredHeight, DefSize.CY);
if Style = tbsDropDown then if Style = tbsDropDown then
inc(PreferredWidth, FToolBar.FDropDownWidth); inc(PreferredWidth, FToolBar.FDropDownWidth);
end end