cocoa: don't change buttons font, if a custom font has been selected

git-svn-id: trunk@61768 -
This commit is contained in:
dmitry 2019-08-27 22:37:28 +00:00
parent 159d5cc8cc
commit 462398fd23

View File

@ -258,6 +258,7 @@ type
class procedure SetText(const AWinControl: TWinControl; const AText: String); override;
class function GetText(const AWinControl: TWinControl; var AText: String): Boolean; override;
class function GetTextLen(const AWinControl: TWinControl; var ALength: Integer): Boolean; override;
class procedure SetFont(const AWinControl: TWinControl; const AFont: TFont); override;
end;
{ TLCLCheckBoxCallback }
@ -743,6 +744,15 @@ begin
Result := false;
end;
class procedure TCocoaWSButton.SetFont(const AWinControl: TWinControl;
const AFont: TFont);
begin
if not (AWinControl.HandleAllocated) then Exit;
TCocoaWSWinControl.SetFont(AWinControl, AFont);
TCocoaButton(AWinControl.Handle).adjustFontToControlSize := (AFont.Name = 'default')
and (AFont.Size = 0);
end;
{ TCocoaWSCustomCheckBox }
{------------------------------------------------------------------------------