Add About dialog and app metadata

This commit is contained in:
Ray Berezowski
2026-06-02 18:57:04 -04:00
parent d328c38f31
commit 27a67d2136
7 changed files with 197 additions and 9 deletions

View File

@@ -4,7 +4,6 @@ using System.Windows.Forms;
using System.Windows.Media;
using System.IO;
using System.Windows.Input;
using System.Reflection;
using TaskbarLauncher.Models;
using TaskbarLauncher.Services;
using MessageBox = System.Windows.MessageBox;
@@ -35,7 +34,7 @@ public partial class MainWindow : Window
DisplayModeBox.ItemsSource = Enum.GetValues<LauncherDisplayMode>();
ItemDisplayModeBox.ItemsSource = Enum.GetValues<LauncherDisplayMode>();
TypeBox.ItemsSource = Enum.GetValues<LauncherItemType>();
VersionText.Text = $"Version {GetAppVersion()}";
VersionText.Text = $"Version {AppInfo.Version} Build {AppInfo.Build}";
RefreshView();
}
@@ -68,13 +67,6 @@ public partial class MainWindow : Window
}
}
private static string GetAppVersion()
{
return Assembly.GetExecutingAssembly()
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?
.InformationalVersion ?? "development";
}
private static TreeViewItem CreateTreeItem(LauncherItem item)
{
var treeItem = new TreeViewItem { Header = $"{item.Title} ({item.Type})", Tag = item };
@@ -701,6 +693,16 @@ public partial class MainWindow : Window
ConfigService.OpenConfigFolder();
}
private void About_Click(object sender, RoutedEventArgs e)
{
AboutWindow aboutWindow = new()
{
Owner = this
};
aboutWindow.ShowDialog();
}
private void Close_Click(object sender, RoutedEventArgs e)
{
Hide();