Fix dialog being "glued" to calling form on gtk2. Fix behaviour when dialog font is not found.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8153 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2021-11-23 09:47:53 +00:00
parent a0993874a1
commit d95f7b808e
2 changed files with 3 additions and 3 deletions

View File

@@ -66,7 +66,7 @@ implementation
{$R *.lfm}
uses
LCLIntf, LCLType, InterfaceBase, TypInfo,
LCLIntf, LCLType, InterfaceBase, TypInfo, Math,
{$IF FPC_FullVersion >= 30202}System.{$IFEND}UITypes;
const
@@ -283,7 +283,7 @@ end;
procedure TDemoForm.FormCreate(Sender: TObject);
begin
cbFontName.Items.Assign(Screen.Fonts);
cbFontName.ItemIndex := cbFontName.Items.IndexOf('Consolas');;
cbFontName.ItemIndex := Max(0, cbFontName.Items.IndexOf('Liberation Sans'));
cbFontName.Enabled := false;
seFontSize.Enabled := false;
lblResult.Caption := '';