diff --git a/lcl/buttons.pp b/lcl/buttons.pp index c4c5a32ea1..f84a6f8434 100644 --- a/lcl/buttons.pp +++ b/lcl/buttons.pp @@ -301,6 +301,8 @@ type function GetNumGlyphs: Integer; procedure GlyphChanged(Sender: TObject); function DialogChar(var Message: TLMKey): boolean; override; + procedure CalculatePreferredSize(var PreferredWidth, + PreferredHeight: integer; WithThemeSpace: Boolean); override; procedure MeasureDraw(Draw: boolean; PaintRect: TRect; out PreferredWidth, PreferredHeight: integer); procedure MouseEnter; override; diff --git a/lcl/include/speedbutton.inc b/lcl/include/speedbutton.inc index 3579517ae4..19b0a8b3fd 100644 --- a/lcl/include/speedbutton.inc +++ b/lcl/include/speedbutton.inc @@ -490,6 +490,15 @@ begin Result := inherited DialogChar(Message); end; +procedure TCustomSpeedButton.CalculatePreferredSize(var PreferredWidth, + PreferredHeight: integer; WithThemeSpace: Boolean); +var + r: TRect; +begin + r:=Rect(0,0,0,0); + MeasureDraw(false,r,PreferredWidth,PreferredHeight); +end; + procedure TCustomSpeedButton.MeasureDraw(Draw: boolean; PaintRect: TRect; out PreferredWidth, PreferredHeight: integer); var