Skip to content

Commit

Permalink
Make hide children setting take effect immediately
Browse files Browse the repository at this point in the history
also correct accessibility levels in FilteredViewConverter and CodeViewConverter.
  • Loading branch information
zivmaor committed Sep 21, 2024
1 parent 7769b1d commit 1a72e8c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion UndertaleModTool/Converters/CodeViewConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace UndertaleModTool
[ValueConversion(typeof(object), typeof(ICollectionView))]
public class CodeViewConverter : FilteredViewConverter
{
public override Predicate<object> CreateFilter()
protected override Predicate<object> CreateFilter()
{
Predicate<object> baseFilter = base.CreateFilter();
return (obj) =>
Expand Down
2 changes: 1 addition & 1 deletion UndertaleModTool/Converters/FilteredViewConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public string Filter
set { SetValue(FilterProperty, value); }
}

public virtual Predicate<object> CreateFilter()
protected virtual Predicate<object> CreateFilter()
{
return (obj) =>
{
Expand Down
2 changes: 1 addition & 1 deletion UndertaleModTool/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ private void SetIDString(string str)
[DllImport("user32.dll", SetLastError = true)]
private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);

private void UpdateTree()
public void UpdateTree()
{
foreach (var child in (MainTree.Items[0] as TreeViewItem).Items)
((child as TreeViewItem).ItemsSource as ICollectionView)?.Refresh();
Expand Down
3 changes: 3 additions & 0 deletions UndertaleModTool/Windows/SettingsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ public static bool HideChildCodeEntries
{
Settings.Instance.HideChildCodeEntries = value;
Settings.Save();

// Refresh the tree to make the changes take effect.
mainWindow.UpdateTree();
}
}

Expand Down

0 comments on commit 1a72e8c

Please sign in to comment.