diff --git a/src/UniGetUI/MainWindow.xaml.cs b/src/UniGetUI/MainWindow.xaml.cs index eb73f143d..becbc1855 100644 --- a/src/UniGetUI/MainWindow.xaml.cs +++ b/src/UniGetUI/MainWindow.xaml.cs @@ -61,7 +61,10 @@ public MainWindow() ExtendsContentIntoTitleBar = true; AppWindow.TitleBar.PreferredHeightOption = TitleBarHeightOption.Tall; SetTitleBar(MainContentGrid); - MainContentGrid.ActualThemeChanged += (_, _) => ApplyTitleBarButtonColors(); + // System theme changed at runtime: re-sync the cached theme, title bar and tray icon + MainContentGrid.ActualThemeChanged += (_, _) => { ApplyTheme(); UpdateSystemTrayStatus(); }; + // Tray icon follows the system theme even when the app theme is fixed + MainApp.Instance.ThemeListener.ThemeChanged += (_) => DispatcherQueue.TryEnqueue(UpdateSystemTrayStatus); AppWindow.SetIcon( Path.Join(CoreData.UniGetUIExecutableDirectory, "Assets", "Images", "icon.ico") );