#72, version 0.9.2.17

This commit is contained in:
Markus Hofknecht 2020-04-07 19:29:02 +02:00
parent e913c011e3
commit 03acc34e04
3 changed files with 7 additions and 23 deletions

View file

@ -33,7 +33,6 @@ namespace SystemTrayMenu
{ {
AppRestart.BeforeRestarting += Dispose; AppRestart.BeforeRestarting += Dispose;
SystemEvents.DisplaySettingsChanged += AppRestart.ByDisplaySettings; SystemEvents.DisplaySettingsChanged += AppRestart.ByDisplaySettings;
menus[0] = new Menu(Menu.MenuState.DisposedFake);
waitLeave.LeaveTriggered += FadeHalfOrOutIfNeeded; waitLeave.LeaveTriggered += FadeHalfOrOutIfNeeded;
keyboardInput = new KeyboardInput(menus); keyboardInput = new KeyboardInput(menus);
keyboardInput.RegisterHotKey(); keyboardInput.RegisterHotKey();
@ -144,18 +143,10 @@ namespace SystemTrayMenu
} }
} }
#warning todo #warning #72, #73 First start slower than others
//Workaround to preload cache menus[0] = CreateMenu(ReadMenu(worker, Config.Path, 0),
SwitchOpenClose(); Path.GetFileName(Config.Path));
while (worker.IsBusy) DisposeMenu(menus[0]);
{
Application.DoEvents();
}
SwitchOpenClose();
//or better load without showing?
//menus[0] = CreateMenu( //not the same?
// ReadMenu(worker, Config.Path, 0),
// Path.GetFileName(Config.Path));
} }
public void Dispose() public void Dispose()

View file

@ -35,5 +35,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.2.16")] [assembly: AssemblyVersion("0.9.2.17")]
[assembly: AssemblyFileVersion("0.9.2.16")] [assembly: AssemblyFileVersion("0.9.2.17")]

View file

@ -35,9 +35,7 @@ namespace SystemTrayMenu.UserInterface
private readonly Fading fading = new Fading(); private readonly Fading fading = new Fading();
private bool autoResizeRowsDone = false; private bool autoResizeRowsDone = false;
internal enum MenuState { Default, DisposedFake }; internal Menu()
internal Menu(MenuState menuType = MenuState.Default)
{ {
fading.ChangeOpacity += Fading_ChangeOpacity; fading.ChangeOpacity += Fading_ChangeOpacity;
void Fading_ChangeOpacity(object sender, double newOpacity) void Fading_ChangeOpacity(object sender, double newOpacity)
@ -77,11 +75,6 @@ namespace SystemTrayMenu.UserInterface
{ {
MouseLeave.Invoke(); MouseLeave.Invoke();
} }
if (menuType == MenuState.DisposedFake)
{
Dispose();
}
} }
private static void SetDoubleBuffer(Control ctl, bool DoubleBuffered) private static void SetDoubleBuffer(Control ctl, bool DoubleBuffered)