Skip to content

Commit a75553f

Browse files
authored
Merge pull request #3543 from onesounds/250514-FixColorSchemeChanging
Fix system ColorScheme update handling
2 parents c1ba81e + f29ccb3 commit a75553f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public MainWindow()
8989

9090
InitSoundEffects();
9191
DataObject.AddPastingHandler(QueryTextBox, QueryTextBox_OnPaste);
92-
92+
ModernWpf.ThemeManager.Current.ActualApplicationThemeChanged += ThemeManager_ActualApplicationThemeChanged;
9393
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
9494
}
9595

@@ -99,6 +99,11 @@ public MainWindow()
9999

100100
#pragma warning disable VSTHRD100 // Avoid async void methods
101101

102+
private void ThemeManager_ActualApplicationThemeChanged(ModernWpf.ThemeManager sender, object args)
103+
{
104+
_theme.RefreshFrameAsync();
105+
}
106+
102107
private void OnSourceInitialized(object sender, EventArgs e)
103108
{
104109
var handle = Win32Helper.GetWindowHandle(this, true);
@@ -1251,6 +1256,7 @@ protected virtual void Dispose(bool disposing)
12511256
_notifyIcon?.Dispose();
12521257
animationSoundWMP?.Close();
12531258
animationSoundWPF?.Dispose();
1259+
ModernWpf.ThemeManager.Current.ActualApplicationThemeChanged -= ThemeManager_ActualApplicationThemeChanged;
12541260
SystemEvents.PowerModeChanged -= SystemEvents_PowerModeChanged;
12551261
}
12561262

0 commit comments

Comments
 (0)