Leandro Diaz преди 4 години
родител
ревизия
c2607c7fb7
променени са 2 файла, в които са добавени 5 реда и са изтрити 2 реда
  1. 0 2
      bgrasvgtheme.pas
  2. 5 0
      bgrathemebutton.pas

+ 0 - 2
bgrasvgtheme.pas

@@ -623,8 +623,6 @@ end;
 function TBGRASVGTheme.PreferredButtonHeight(const hasGlyph: boolean): Integer;
 begin
   Result := (FButtonTextSpacing * 2);
-  if (hasGlyph) then
-    Result := Result + FGlyphTextSpacing;
 end;
 
 function TBGRASVGTheme.PreferredButtonWidth(const hasGlyph: boolean): Integer;

+ 5 - 0
bgrathemebutton.pas

@@ -114,6 +114,11 @@ begin
   begin
     PreferredWidth := Canvas.TextWidth(Caption) + Theme.PreferredButtonWidth(Assigned(FImageList));
     PreferredHeight := Canvas.TextHeight(Caption) + Theme.PreferredButtonHeight(Assigned(FImageList));
+    if Assigned(FImageList) then
+    begin
+      PreferredWidth := PreferredWidth + FImageList.Width;
+      PreferredHeight := PreferredHeight + FImageList.Height;
+    end;
   end;
 end;