mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 18:17:18 +02:00
LCL: Add support for custom font of TSpeedButton (see https://forum.lazarus.freepascal.org/index.php/topic,42635.msg297800.html#msg297800, patch by Ondrej)
git-svn-id: trunk@59149 -
This commit is contained in:
parent
fc89b79dc9
commit
a7ce6e3055
@ -572,6 +572,7 @@ var
|
||||
HasGlyph: Boolean;
|
||||
HasText: Boolean;
|
||||
CurLayout: TButtonLayout;
|
||||
SysFont: TFont;
|
||||
begin
|
||||
if FGlyph = nil then exit;
|
||||
|
||||
@ -736,8 +737,19 @@ begin
|
||||
TextFlags := TextFlags or DT_RTLREADING;
|
||||
|
||||
if Draw then
|
||||
ThemeServices.DrawText(Canvas, DrawDetails, Caption, PaintRect,
|
||||
TextFlags, 0);
|
||||
begin
|
||||
SysFont := Screen.SystemFont;
|
||||
if (SysFont.Color=Font.Color)
|
||||
and ((SysFont.Name=Font.Name) or IsFontNameDefault(Font.Name))
|
||||
and (SysFont.Pitch=Font.Pitch)
|
||||
and (SysFont.Style=Font.Style) then
|
||||
ThemeServices.DrawText(Canvas, DrawDetails, Caption, PaintRect, TextFlags, 0)
|
||||
else
|
||||
begin
|
||||
Canvas.Brush.Style := bsClear;
|
||||
DrawText(Canvas.Handle, PChar(Caption), Length(Caption), PaintRect, TextFlags);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end else begin
|
||||
// measuring, not drawing
|
||||
|
Loading…
Reference in New Issue
Block a user