diff --git a/GenshinLyreMidiPlayer.WPF/ViewModels/MainWindowViewModel.cs b/GenshinLyreMidiPlayer.WPF/ViewModels/MainWindowViewModel.cs index 37e432b..708bf8c 100644 --- a/GenshinLyreMidiPlayer.WPF/ViewModels/MainWindowViewModel.cs +++ b/GenshinLyreMidiPlayer.WPF/ViewModels/MainWindowViewModel.cs @@ -62,11 +62,11 @@ public void ToggleTheme() { ThemeManager.Current.ApplicationTheme = _theme.GetTheme() switch { - ThemeType.Unknown => ApplicationTheme.Dark, - ThemeType.Dark => ApplicationTheme.Light, - ThemeType.Light => ApplicationTheme.Dark, + ThemeType.Unknown => ApplicationTheme.Dark, + ThemeType.Dark => ApplicationTheme.Light, + ThemeType.Light => ApplicationTheme.Dark, ThemeType.HighContrast => ApplicationTheme.Dark, - _ => ApplicationTheme.Dark + _ => ApplicationTheme.Dark }; SettingsView.OnThemeChanged(); diff --git a/GenshinLyreMidiPlayer.WPF/ViewModels/SettingsPageViewModel.cs b/GenshinLyreMidiPlayer.WPF/ViewModels/SettingsPageViewModel.cs index 7993045..5e3d913 100644 --- a/GenshinLyreMidiPlayer.WPF/ViewModels/SettingsPageViewModel.cs +++ b/GenshinLyreMidiPlayer.WPF/ViewModels/SettingsPageViewModel.cs @@ -319,20 +319,11 @@ await Task.Delay(start, PlayTimerToken.Token) [UsedImplicitly] public void OnThemeChanged() { - ThemeManager.Current.ApplicationTheme ??= _theme.GetSystemTheme() switch - { - ThemeType.Unknown => ApplicationTheme.Light, - ThemeType.Dark => ApplicationTheme.Dark, - ThemeType.Light => ApplicationTheme.Light, - ThemeType.HighContrast => ApplicationTheme.Dark, - _ => ApplicationTheme.Light - }; - _theme.SetTheme(ThemeManager.Current.ApplicationTheme switch { ApplicationTheme.Light => ThemeType.Light, ApplicationTheme.Dark => ThemeType.Dark, - _ => ThemeType.Light + _ => _theme.GetSystemTheme() }); Settings.Modify(s => s.AppTheme = (int?) ThemeManager.Current.ApplicationTheme ?? -1);