Merge pull request #3543 from onesounds/250514-FixColorSchemeChanging

Fix system ColorScheme update handling
This commit is contained in:
DB P 2025-05-14 13:16:14 +09:00 committed by GitHub
commit a75553fbcf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -89,7 +89,7 @@ namespace Flow.Launcher
InitSoundEffects(); InitSoundEffects();
DataObject.AddPastingHandler(QueryTextBox, QueryTextBox_OnPaste); DataObject.AddPastingHandler(QueryTextBox, QueryTextBox_OnPaste);
ModernWpf.ThemeManager.Current.ActualApplicationThemeChanged += ThemeManager_ActualApplicationThemeChanged;
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
} }
@ -99,6 +99,11 @@ namespace Flow.Launcher
#pragma warning disable VSTHRD100 // Avoid async void methods #pragma warning disable VSTHRD100 // Avoid async void methods
private void ThemeManager_ActualApplicationThemeChanged(ModernWpf.ThemeManager sender, object args)
{
_theme.RefreshFrameAsync();
}
private void OnSourceInitialized(object sender, EventArgs e) private void OnSourceInitialized(object sender, EventArgs e)
{ {
var handle = Win32Helper.GetWindowHandle(this, true); var handle = Win32Helper.GetWindowHandle(this, true);
@ -1251,6 +1256,7 @@ namespace Flow.Launcher
_notifyIcon?.Dispose(); _notifyIcon?.Dispose();
animationSoundWMP?.Close(); animationSoundWMP?.Close();
animationSoundWPF?.Dispose(); animationSoundWPF?.Dispose();
ModernWpf.ThemeManager.Current.ActualApplicationThemeChanged -= ThemeManager_ActualApplicationThemeChanged;
SystemEvents.PowerModeChanged -= SystemEvents_PowerModeChanged; SystemEvents.PowerModeChanged -= SystemEvents_PowerModeChanged;
} }