From bac953a9e45e075c3ade9891264e9271b2ea31a6 Mon Sep 17 00:00:00 2001 From: ImKventis Date: Mon, 6 Jan 2025 15:39:13 +0000 Subject: [PATCH] Maintain custom set icon --- .../SystrayShell/Program.cs | 9 +++++++-- .../SystrayShell/SystrayForm.cs | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs b/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs index a868b7a..3455e3c 100644 --- a/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs +++ b/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs @@ -476,7 +476,9 @@ if not errorlevel 1 goto wait_to_finish"; else { NotifyIcon ni = systrayForm.notifyIconMain; - ni.Icon = BusyIcon; + if (!systrayForm.toggleIcon) { + ni.Icon = BusyIcon; + } if (silent) return; @@ -501,7 +503,10 @@ if not errorlevel 1 goto wait_to_finish"; else { NotifyIcon ni = systrayForm.notifyIconMain; - ni.Icon = IdleIcon; + if (!systrayForm.toggleIcon) + { + ni.Icon = IdleIcon; + } if (Gui) { diff --git a/Ninjacrab.PersistentWindows.Solution/SystrayShell/SystrayForm.cs b/Ninjacrab.PersistentWindows.Solution/SystrayShell/SystrayForm.cs index 3c453f8..e7bd829 100644 --- a/Ninjacrab.PersistentWindows.Solution/SystrayShell/SystrayForm.cs +++ b/Ninjacrab.PersistentWindows.Solution/SystrayShell/SystrayForm.cs @@ -18,7 +18,7 @@ namespace PersistentWindows.SystrayShell private const int MaxSnapshots = 38; // 0-9, a-z, ` and final one for undo private bool pauseAutoRestore = false; - private bool toggleIcon = false; + public bool toggleIcon = false; private int skipUpgradeCounter = 0; private bool pauseUpgradeCounter = false;