fix: 修复任务栏固定和右键菜单图标不显示问题
This commit is contained in:
15
MainForm.cs
15
MainForm.cs
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user