mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-06-17 01:45:03 +12:00
This commit is contained in:
parent
ec7a2467f1
commit
fd554ec7ea
|
@ -75,13 +75,26 @@ namespace SystemTrayMenu.Business
|
|||
switch (menuData.Validity)
|
||||
{
|
||||
case MenuDataValidity.Valid:
|
||||
if (!Properties.Settings.Default.CacheMainMenu)
|
||||
if (Properties.Settings.Default.CacheMainMenu)
|
||||
{
|
||||
if (IconReader.MainPreload)
|
||||
{
|
||||
workerMainMenu.DoWork -= LoadMenu;
|
||||
menus[0] = Create(menuData, Path.GetFileName(Config.Path));
|
||||
IconReader.MainPreload = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
AsEnumerable.ToList().ForEach(m => { m.ShowWithFade(); });
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DisposeMenu(menus[menuData.Level]);
|
||||
menus[0] = Create(menuData, Path.GetFileName(Config.Path));
|
||||
AsEnumerable.ToList().ForEach(m => { m.ShowWithFade(); });
|
||||
}
|
||||
|
||||
AsEnumerable.ToList().ForEach(m => { m.ShowWithFade(); });
|
||||
break;
|
||||
case MenuDataValidity.Empty:
|
||||
if (!showingMessageBox)
|
||||
|
@ -591,28 +604,25 @@ namespace SystemTrayMenu.Business
|
|||
|
||||
internal void MainPreload()
|
||||
{
|
||||
IconReader.SingleThread = true;
|
||||
LoadStarted();
|
||||
menus[0] = Create(
|
||||
GetData(workerMainMenu, Config.Path, 0),
|
||||
Path.GetFileName(Config.Path));
|
||||
IconReader.SingleThread = false;
|
||||
AdjustMenusSizeAndLocation();
|
||||
if (Properties.Settings.Default.CacheMainMenu)
|
||||
{
|
||||
workerMainMenu.DoWork -= LoadMenu;
|
||||
}
|
||||
else
|
||||
{
|
||||
DisposeMenu(menus[0]);
|
||||
}
|
||||
|
||||
LoadStopped();
|
||||
IconReader.MainPreload = true;
|
||||
|
||||
if (FileUrl.GetDefaultBrowserPath(out string browserPath))
|
||||
{
|
||||
IconReader.GetFileIconWithCache(browserPath, true, true, out _);
|
||||
}
|
||||
|
||||
timerShowProcessStartedAsLoadingIcon.Tick += Tick;
|
||||
timerShowProcessStartedAsLoadingIcon.Start();
|
||||
void Tick(object sender, EventArgs e)
|
||||
{
|
||||
timerShowProcessStartedAsLoadingIcon.Tick -= Tick;
|
||||
SwitchOpenClose(false);
|
||||
}
|
||||
|
||||
if (!Properties.Settings.Default.CacheMainMenu)
|
||||
{
|
||||
DisposeMenu(menus[0]);
|
||||
}
|
||||
}
|
||||
|
||||
internal void StartWorker()
|
||||
|
@ -1080,7 +1090,7 @@ namespace SystemTrayMenu.Business
|
|||
|
||||
private void FadeHalfOrOutIfNeeded()
|
||||
{
|
||||
if (menus[0].IsUsable)
|
||||
if (menus[0] != null && menus[0].IsUsable)
|
||||
{
|
||||
if (!IsActive())
|
||||
{
|
||||
|
|
|
@ -39,5 +39,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("1.0.25.7")]
|
||||
[assembly: AssemblyFileVersion("1.0.25.7")]
|
||||
[assembly: AssemblyVersion("1.0.25.8")]
|
||||
[assembly: AssemblyFileVersion("1.0.25.8")]
|
||||
|
|
|
@ -89,7 +89,6 @@ namespace SystemTrayMenu.UserInterface
|
|||
{
|
||||
threadsLoading = true;
|
||||
load.Start();
|
||||
Load_Tick(load, null);
|
||||
}
|
||||
|
||||
public void LoadingStop()
|
||||
|
@ -124,9 +123,8 @@ namespace SystemTrayMenu.UserInterface
|
|||
notifyIcon.Icon = systemTrayMenu;
|
||||
load.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private void DisposeIconIfNotDefaultIcon()
|
||||
void DisposeIconIfNotDefaultIcon()
|
||||
{
|
||||
if (notifyIcon.Icon.GetHashCode() != systemTrayMenu.GetHashCode())
|
||||
{
|
||||
|
@ -134,4 +132,5 @@ namespace SystemTrayMenu.UserInterface
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -149,9 +149,7 @@ namespace SystemTrayMenu.UserInterface.FolderBrowseDialog
|
|||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
#if DEBUG
|
||||
GC.SuppressFinalize(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
|
|
|
@ -280,7 +280,7 @@ namespace SystemTrayMenu.UserInterface
|
|||
|
||||
try
|
||||
{
|
||||
foreach (string pathAndRecursivString in Properties.Settings.Default.PathsAddToMainMenu.Split(@"|"))
|
||||
foreach (string pathAndRecursivString in Settings.Default.PathsAddToMainMenu.Split(@"|"))
|
||||
{
|
||||
if (string.IsNullOrEmpty(pathAndRecursivString))
|
||||
{
|
||||
|
|
6
UserInterface/TaskbarForm.Designer.cs
generated
6
UserInterface/TaskbarForm.Designer.cs
generated
|
@ -36,8 +36,10 @@
|
|||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.BackColor = System.Drawing.Color.White;
|
||||
this.ClientSize = new System.Drawing.Size(120, 0);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||
this.ClientSize = new System.Drawing.Size(159, 136);
|
||||
this.DoubleBuffered = true;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "TaskbarForm";
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -37,7 +37,7 @@ namespace SystemTrayMenu.Utilities
|
|||
}
|
||||
|
||||
// see https://github.com/Hofknecht/SystemTrayMenu/issues/209.
|
||||
public static bool SingleThread { get; set; }
|
||||
public static bool MainPreload { get; set; }
|
||||
|
||||
public static void Dispose()
|
||||
{
|
||||
|
@ -222,7 +222,7 @@ namespace SystemTrayMenu.Utilities
|
|||
|
||||
if (updateIconInBackground)
|
||||
{
|
||||
if (SingleThread)
|
||||
if (MainPreload)
|
||||
{
|
||||
DictIconCache.GetOrAdd(key, GetFolder);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue