From 2b46fda541c827479650129d11b49b80b88d4538 Mon Sep 17 00:00:00 2001 From: Kang Yu Date: Fri, 19 Jan 2024 14:53:19 -0800 Subject: [PATCH] change icon when upgrade version is detected --- .../SystrayShell/Program.cs | 6 ++++++ .../SystrayShell/SystrayForm.cs | 3 +++ 2 files changed, 9 insertions(+) diff --git a/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs b/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs index b6cf80b..a272851 100644 --- a/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs +++ b/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs @@ -19,6 +19,7 @@ namespace PersistentWindows.SystrayShell public static readonly string Contributors = $@"{ProjectUrl}/graphs/contributors"; public static System.Drawing.Icon IdleIcon = null; public static System.Drawing.Icon BusyIcon = null; + public static System.Drawing.Icon UpdateIcon = null; public static string AppdataFolder = null; public static string CmdArgs; public static bool Gui = true; @@ -265,6 +266,11 @@ namespace PersistentWindows.SystrayShell BusyIcon = System.Drawing.Icon.FromHandle(iconHandle); } + { + var iconHandle = Properties.Resources.pwIconUpdate.GetHicon(); + UpdateIcon = System.Drawing.Icon.FromHandle(iconHandle); + } + systrayForm = new SystrayForm(); systrayForm.enableUpgradeNotice = check_upgrade; systrayForm.autoUpgrade = auto_upgrade; diff --git a/Ninjacrab.PersistentWindows.Solution/SystrayShell/SystrayForm.cs b/Ninjacrab.PersistentWindows.Solution/SystrayShell/SystrayForm.cs index 59cca4c..111b73e 100644 --- a/Ninjacrab.PersistentWindows.Solution/SystrayShell/SystrayForm.cs +++ b/Ninjacrab.PersistentWindows.Solution/SystrayShell/SystrayForm.cs @@ -248,7 +248,10 @@ namespace PersistentWindows.SystrayShell if (autoUpgrade) Upgrade(); else + { upgradeNoticeMenuItem.Text = $"Upgrade to {latestVersion}"; + notifyIconMain.Icon = Program.UpdateIcon; + } } } }