From d95f7b808e4eda35558cb6f014a482f5cc42f002 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Tue, 23 Nov 2021 09:47:53 +0000 Subject: [PATCH] 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 --- components/exctrls/examples/QuestionDlgEx/main.pas | 4 ++-- components/exctrls/source/exquestiondlg.pas | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/exctrls/examples/QuestionDlgEx/main.pas b/components/exctrls/examples/QuestionDlgEx/main.pas index 1810b667d..33f9d114b 100644 --- a/components/exctrls/examples/QuestionDlgEx/main.pas +++ b/components/exctrls/examples/QuestionDlgEx/main.pas @@ -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 := ''; diff --git a/components/exctrls/source/exquestiondlg.pas b/components/exctrls/source/exquestiondlg.pas index bb0d5ff7a..e9779ac77 100644 --- a/components/exctrls/source/exquestiondlg.pas +++ b/components/exctrls/source/exquestiondlg.pas @@ -128,7 +128,7 @@ type constructor TQForm.CreateNew(AOwner: TComponent; Num: Integer = 0); begin inherited; - BorderStyle := bsDialog; + BorderStyle := bsSingle; // In gth2, bsDialog "glues" the dialog to the calling form BorderIcons := [biSystemMenu]; Color := clWindow; PopupMode := pmAuto;