From 03acc34e0489770ca2238852633865248400dca9 Mon Sep 17 00:00:00 2001 From: Markus Hofknecht Date: Tue, 7 Apr 2020 19:29:02 +0200 Subject: [PATCH] #72, version 0.9.2.17 --- Business/SystemTrayMenu.cs | 17 ++++------------- Properties/AssemblyInfo.cs | 4 ++-- UserInterface/Menu.cs | 9 +-------- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/Business/SystemTrayMenu.cs b/Business/SystemTrayMenu.cs index f11ec01..4eb88ed 100644 --- a/Business/SystemTrayMenu.cs +++ b/Business/SystemTrayMenu.cs @@ -33,7 +33,6 @@ namespace SystemTrayMenu { AppRestart.BeforeRestarting += Dispose; SystemEvents.DisplaySettingsChanged += AppRestart.ByDisplaySettings; - menus[0] = new Menu(Menu.MenuState.DisposedFake); waitLeave.LeaveTriggered += FadeHalfOrOutIfNeeded; keyboardInput = new KeyboardInput(menus); keyboardInput.RegisterHotKey(); @@ -144,18 +143,10 @@ namespace SystemTrayMenu } } -#warning todo - //Workaround to preload cache - SwitchOpenClose(); - while (worker.IsBusy) - { - Application.DoEvents(); - } - SwitchOpenClose(); - //or better load without showing? - //menus[0] = CreateMenu( //not the same? - // ReadMenu(worker, Config.Path, 0), - // Path.GetFileName(Config.Path)); +#warning #72, #73 First start slower than others + menus[0] = CreateMenu(ReadMenu(worker, Config.Path, 0), + Path.GetFileName(Config.Path)); + DisposeMenu(menus[0]); } public void Dispose() diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 0242612..5d81d12 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -35,5 +35,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.9.2.16")] -[assembly: AssemblyFileVersion("0.9.2.16")] +[assembly: AssemblyVersion("0.9.2.17")] +[assembly: AssemblyFileVersion("0.9.2.17")] diff --git a/UserInterface/Menu.cs b/UserInterface/Menu.cs index 5527bd2..ac74898 100644 --- a/UserInterface/Menu.cs +++ b/UserInterface/Menu.cs @@ -35,9 +35,7 @@ namespace SystemTrayMenu.UserInterface private readonly Fading fading = new Fading(); private bool autoResizeRowsDone = false; - internal enum MenuState { Default, DisposedFake }; - - internal Menu(MenuState menuType = MenuState.Default) + internal Menu() { fading.ChangeOpacity += Fading_ChangeOpacity; void Fading_ChangeOpacity(object sender, double newOpacity) @@ -77,11 +75,6 @@ namespace SystemTrayMenu.UserInterface { MouseLeave.Invoke(); } - - if (menuType == MenuState.DisposedFake) - { - Dispose(); - } } private static void SetDoubleBuffer(Control ctl, bool DoubleBuffered)