Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 09b68ada48 |
14
App.xaml.cs
14
App.xaml.cs
@@ -48,7 +48,6 @@ public partial class App : System.Windows.Application
|
||||
_server.Start(State.Settings.LocalPort);
|
||||
|
||||
CreateTrayIcon();
|
||||
ShowMainWindow();
|
||||
}
|
||||
|
||||
public void SaveState()
|
||||
@@ -69,6 +68,17 @@ public partial class App : System.Windows.Application
|
||||
MainWindow.Activate();
|
||||
}
|
||||
|
||||
public void ToggleMainWindow()
|
||||
{
|
||||
if (MainWindow?.IsVisible == true)
|
||||
{
|
||||
MainWindow.Hide();
|
||||
return;
|
||||
}
|
||||
|
||||
ShowMainWindow();
|
||||
}
|
||||
|
||||
private void RegisterActivationListener()
|
||||
{
|
||||
if (_activateEvent is null)
|
||||
@@ -96,7 +106,7 @@ public partial class App : System.Windows.Application
|
||||
{
|
||||
if (args.Button == Forms.MouseButtons.Left)
|
||||
{
|
||||
Dispatcher.Invoke(ShowMainWindow);
|
||||
Dispatcher.Invoke(ToggleMainWindow);
|
||||
}
|
||||
};
|
||||
UpdateTrayMenu();
|
||||
|
||||
Reference in New Issue
Block a user