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);
|
_server.Start(State.Settings.LocalPort);
|
||||||
|
|
||||||
CreateTrayIcon();
|
CreateTrayIcon();
|
||||||
ShowMainWindow();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveState()
|
public void SaveState()
|
||||||
@@ -69,6 +68,17 @@ public partial class App : System.Windows.Application
|
|||||||
MainWindow.Activate();
|
MainWindow.Activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ToggleMainWindow()
|
||||||
|
{
|
||||||
|
if (MainWindow?.IsVisible == true)
|
||||||
|
{
|
||||||
|
MainWindow.Hide();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ShowMainWindow();
|
||||||
|
}
|
||||||
|
|
||||||
private void RegisterActivationListener()
|
private void RegisterActivationListener()
|
||||||
{
|
{
|
||||||
if (_activateEvent is null)
|
if (_activateEvent is null)
|
||||||
@@ -96,7 +106,7 @@ public partial class App : System.Windows.Application
|
|||||||
{
|
{
|
||||||
if (args.Button == Forms.MouseButtons.Left)
|
if (args.Button == Forms.MouseButtons.Left)
|
||||||
{
|
{
|
||||||
Dispatcher.Invoke(ShowMainWindow);
|
Dispatcher.Invoke(ToggleMainWindow);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
UpdateTrayMenu();
|
UpdateTrayMenu();
|
||||||
|
|||||||
Reference in New Issue
Block a user