Add About dialog and app metadata
This commit is contained in:
@@ -13,6 +13,7 @@ public sealed class LauncherController : IDisposable
|
||||
private NotifyIcon? notifyIcon;
|
||||
private LauncherPopup? popup;
|
||||
private MainWindow? settingsWindow;
|
||||
private AboutWindow? aboutWindow;
|
||||
|
||||
public LauncherConfig Config { get; private set; } = new();
|
||||
|
||||
@@ -38,6 +39,20 @@ public sealed class LauncherController : IDisposable
|
||||
settingsWindow.Activate();
|
||||
}
|
||||
|
||||
public void ShowAbout()
|
||||
{
|
||||
if (aboutWindow?.IsVisible == true)
|
||||
{
|
||||
aboutWindow.Activate();
|
||||
return;
|
||||
}
|
||||
|
||||
aboutWindow = new AboutWindow();
|
||||
aboutWindow.Closed += (_, _) => aboutWindow = null;
|
||||
aboutWindow.Show();
|
||||
aboutWindow.Activate();
|
||||
}
|
||||
|
||||
public void TogglePopup()
|
||||
{
|
||||
if (popup?.IsVisible == true)
|
||||
@@ -83,6 +98,7 @@ public sealed class LauncherController : IDisposable
|
||||
notifyIcon.DoubleClick += (_, _) => TogglePopup();
|
||||
notifyIcon.ContextMenuStrip.Items.Add("Open Launcher", null, (_, _) => TogglePopup());
|
||||
notifyIcon.ContextMenuStrip.Items.Add("Settings", null, (_, _) => ShowSettings());
|
||||
notifyIcon.ContextMenuStrip.Items.Add("About", null, (_, _) => ShowAbout());
|
||||
notifyIcon.ContextMenuStrip.Items.Add("Reload Config", null, (_, _) => ReloadConfig());
|
||||
notifyIcon.ContextMenuStrip.Items.Add("Open Config Folder", null, (_, _) => ConfigService.OpenConfigFolder());
|
||||
notifyIcon.ContextMenuStrip.Items.Add("Exit", null, (_, _) => System.Windows.Application.Current.Shutdown());
|
||||
|
||||
Reference in New Issue
Block a user