Skip to content

Commit 882cecb

Browse files
committed
fix: Fix the issue with the display of the system tray icon
Adjust the initial visibility setting of the tray icon and remove redundant visibility control logic
1 parent 53fd7bc commit 882cecb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

MainWindow.xaml.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ private void InitializeNotifyIcon()
8383
{
8484
Icon = icon ?? SystemIcons.Application,
8585
Text = Strings.Toolbox,
86-
Visible = false
86+
Visible = true
8787
};
8888

8989
_notifyIcon.MouseClick += (sender, e) =>
@@ -168,7 +168,6 @@ private void ShowWindow()
168168
Show();
169169
WindowState = WindowState.Normal;
170170
Activate();
171-
_notifyIcon!.Visible = false;
172171
}
173172

174173
private void ExitApplication()
@@ -220,8 +219,7 @@ private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs
220219

221220
private void MinimizeToTray()
222221
{
223-
_notifyIcon!.Visible = true;
224-
_notifyIcon.ShowBalloonTip(2000, Strings.Toolbox, Strings.MinimizedToTray, ToolTipIcon.Info);
222+
_notifyIcon!.ShowBalloonTip(2000, Strings.Toolbox, Strings.MinimizedToTray, ToolTipIcon.Info);
225223
Hide();
226224
}
227225

0 commit comments

Comments
 (0)