From 4fd87c207a186f9059c61687ba26a3d40fe46a57 Mon Sep 17 00:00:00 2001 From: David Bannon Date: Mon, 1 May 2023 16:46:14 +1000 Subject: [PATCH] v0.36c, dont show systray until menu items added, fix a Gnome bug --- package/version | 2 +- source/mainunit.lfm | 2 +- source/mainunit.pas | 3 ++- source/searchunit.pas | 2 ++ source/uqt_colors.pas | 5 +++-- whatsnew | 2 ++ 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/package/version b/package/version index ff7468a..cc711e5 100644 --- a/package/version +++ b/package/version @@ -1 +1 @@ -0.36b +0.36c diff --git a/source/mainunit.lfm b/source/mainunit.lfm index 4c4aea2..bca81a5 100644 --- a/source/mainunit.lfm +++ b/source/mainunit.lfm @@ -13,7 +13,7 @@ object MainForm: TMainForm OnKeyDown = FormKeyDown OnResize = FormResize OnShow = FormShow - LCLVersion = '2.2.0.2' + LCLVersion = '2.3.0.0' object ImageNotesDirTick: TImage AnchorSideTop.Control = LabelNotesFound Left = 24 diff --git a/source/mainunit.pas b/source/mainunit.pas index 0ceb7ba..5c15400 100644 --- a/source/mainunit.pas +++ b/source/mainunit.pas @@ -79,6 +79,7 @@ 2022/10/20 To Avoid calling IndexNotes() from Import, now function, IndexNewNote() 2022/11/14 ShowNotifications() now cross platform. 2023/03/17 Provide better support for dark theme, particularly for Qt5 in qt5ct mode + 2023/04/30 Another Gnome (for 44.0) fix, apparently it does not like an empty menu in the trayicon at show. CommandLine Switches @@ -320,7 +321,7 @@ procedure TMainForm.FormCreate(Sender: TObject); if UseTrayMenu then begin PopupMenuTray := TPopupMenu.Create(Self); TrayIcon.PopUpMenu := PopupMenuTray; // SearchForm will populate it when ready - TrayIcon.Show; +// TrayIcon.Show; // Gnome does not like showing it before menu is populated, so, call from SearchForm.create end; LabelBadNoteAdvice.Caption := ''; end; diff --git a/source/searchunit.pas b/source/searchunit.pas index 076ea8d..199d8f1 100644 --- a/source/searchunit.pas +++ b/source/searchunit.pas @@ -1267,6 +1267,8 @@ procedure TSearchForm.FormCreate(Sender: TObject); EditSearch.SelStart := 1; EditSearch.SelLength := length(EditSearch.Text); RefreshMenus(mkAllMenu); // IndexNotes->UseList has already called RefreshMenus(mkRecentMenu) and Qt5 does not like it. + if Mainform.UseTrayMenu then + MainForm.TrayIcon.Show; // Gnome does not like showing it before menu is populated MenuItemCaseSensitive.checked := Sett.SearchCaseSensitive; MenuItemSWYT.checked := Sett.AutoSearchUpdate; MenuItemImportNote.Hint := rsHelpImportFile; // ToDo : OK, where is ShowHint ? diff --git a/source/uqt_colors.pas b/source/uqt_colors.pas index 81855a4..833c4de 100644 --- a/source/uqt_colors.pas +++ b/source/uqt_colors.pas @@ -20,6 +20,7 @@ History : 2023-03-13 Initial release. + 2023-05-01 Handle the possiblity of no qt5ct conf file. } {$mode ObjFPC}{$H+} @@ -74,8 +75,8 @@ function TQt_Colors.GetActiveColors: string; finally ConfigFile.free; end; - end; - if Result = '' then exit; + end else Result := ''; + if Result = '' then exit; // either no qt5ct.conf file or no color_scheme file found. if FileExists(Result) then begin ConfigFile := TINIFile.Create(Result); try diff --git a/whatsnew b/whatsnew index 2602098..96cb763 100644 --- a/whatsnew +++ b/whatsnew @@ -1,2 +1,4 @@ Remove dangling anchors believed to cause a rare layout bug. Faster note loading for large notes. +Qt5 can handle a request to use an unconfigured qt5ct. +Dont show SysTray until menu items added.