fix: 修复任务栏固定和右键菜单图标不显示问题

This commit is contained in:
2026-01-17 16:26:16 +08:00
parent 50955e84c7
commit 74ca8e4d57
4 changed files with 416 additions and 47 deletions

View File

@@ -133,13 +133,20 @@ namespace TimerApp
try
{
// Generate and set custom icon
Icon icon = IconGenerator.GenerateClockIcon();
Icon icon = IconGenerator.GenerateClockIcon(64);
this.Icon = icon;
notifyIcon1.Icon = icon;
contextMenuStrip1.ShowImageMargin = true;
toolStripMenuItemShow.Image = null;
toolStripMenuItemExit.Image = null;
}
catch
{
notifyIcon1.Icon = SystemIcons.Application;
contextMenuStrip1.ShowImageMargin = true;
toolStripMenuItemShow.Image = null;
toolStripMenuItemExit.Image = null;
}
UpdateStatusUI();
@@ -541,6 +548,11 @@ namespace TimerApp
_hasShownMinimizeTip = true;
}
}
else
{
notifyIcon1.Visible = false;
notifyIcon1.Dispose();
}
}
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
@@ -564,6 +576,7 @@ namespace TimerApp
{
_monitor.Stop();
notifyIcon1.Visible = false;
notifyIcon1.Dispose();
Application.Exit();
}