From 0a057562a8fad904283e0dc366aafbcfb8d1dd68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Peyronnet?= Date: Sun, 10 Dec 2023 12:42:21 +0100 Subject: [PATCH] Fixed an issue with nav bar when switching theme (#353) --- ColorPicker/Classes/Global.cs | 3 +++ ColorPicker/MainWindow.xaml.cs | 1 + 2 files changed, 4 insertions(+) diff --git a/ColorPicker/Classes/Global.cs b/ColorPicker/Classes/Global.cs index d49c1226..07db2086 100644 --- a/ColorPicker/Classes/Global.cs +++ b/ColorPicker/Classes/Global.cs @@ -84,6 +84,8 @@ public static class Global } }; + internal static Action RefreshButton { get; set; } + internal static string SynethiaPath => $@"{FileSys.AppDataPath}\Léo Corporation\ColorPicker Max\SynethiaConfig.json"; internal static string BookmarksPath => $@"{FileSys.AppDataPath}\Léo Corporation\ColorPicker Max\Bookmarks.xml"; internal static string SettingsPath => $@"{FileSys.AppDataPath}\Léo Corporation\ColorPicker Max\Settings.xml"; @@ -284,6 +286,7 @@ public static void ChangeTheme(bool reload = false) ChromaticWheelPage.CheckButton(ChromaticWheelPage.CheckedButton); HarmoniesPage.CheckButton(HarmoniesPage.SelectedColorBtn); PalettePage.CheckButton(PalettePage.SelectedColorBtn); + RefreshButton(); } public static bool IsSystemThemeDark() diff --git a/ColorPicker/MainWindow.xaml.cs b/ColorPicker/MainWindow.xaml.cs index e38cfed2..7d5809f0 100644 --- a/ColorPicker/MainWindow.xaml.cs +++ b/ColorPicker/MainWindow.xaml.cs @@ -43,6 +43,7 @@ public MainWindow() { InitializeComponent(); InitUI(); + Global.RefreshButton = () => SettingsPageBtn.Background = Global.GetColorFromResource("Background1"); GC.Collect(); }