Persist selected item display mode changes

This commit is contained in:
Ray Berezowski
2026-06-02 21:52:42 -04:00
parent fb9258d339
commit 84e89ec11c
2 changed files with 23 additions and 1 deletions

View File

@@ -114,6 +114,11 @@ public partial class MainWindow : Window
private void ItemsTree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
{
if (!isLoadingSelection && selectedItem is not null)
{
ApplyCurrentItem();
}
if (e.NewValue is not TreeViewItem treeItem || treeItem.Tag is not LauncherItem item)
{
selectedItem = null;
@@ -946,6 +951,23 @@ public partial class MainWindow : Window
}
}
private void ItemDisplayModeBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (isLoadingSelection)
{
return;
}
if (selectedItem is not null && ItemDisplayModeBox.SelectedItem is LauncherDisplayMode itemMode)
{
selectedItem.DisplayMode = itemMode;
selectedPath = FindItemPath(selectedItem);
StatusText.Text = "Click Save to keep the selected item display mode.";
}
UpdatePreview();
}
private void EnsureAutomaticIconPath()
{
if (TypeBox.SelectedItem is LauncherItemType.Menu)