Add About dialog and app metadata
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user