mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix color scheme change issue & Code cleanup
This commit is contained in:
parent
caa5a4825d
commit
8484c2b87a
1 changed files with 15 additions and 23 deletions
|
|
@ -113,7 +113,15 @@ public partial class SettingsPaneThemeViewModel : BaseModel
|
|||
get => Settings.ColorScheme;
|
||||
set
|
||||
{
|
||||
UpdateColorScheme();
|
||||
ThemeManagerForColorSchemeSwitch.Current.ApplicationTheme = value switch
|
||||
{
|
||||
Infrastructure.UserSettings.ColorSchemes.Light => ApplicationTheme.Light,
|
||||
Infrastructure.UserSettings.ColorSchemes.Dark => ApplicationTheme.Dark,
|
||||
Infrastructure.UserSettings.ColorSchemes.System => null,
|
||||
_ => ThemeManagerForColorSchemeSwitch.Current.ApplicationTheme
|
||||
};
|
||||
|
||||
ThemeManager.Instance.RefreshFrame();
|
||||
|
||||
Settings.ColorScheme = value;
|
||||
}
|
||||
|
|
@ -220,9 +228,8 @@ public partial class SettingsPaneThemeViewModel : BaseModel
|
|||
public BackdropTypes BackdropType
|
||||
{
|
||||
get => Enum.IsDefined(typeof(BackdropTypes), Settings.BackdropType)
|
||||
? (BackdropTypes)Settings.BackdropType
|
||||
? Settings.BackdropType
|
||||
: BackdropTypes.None;
|
||||
|
||||
set
|
||||
{
|
||||
if (!Enum.IsDefined(typeof(BackdropTypes), value))
|
||||
|
|
@ -241,9 +248,6 @@ public partial class SettingsPaneThemeViewModel : BaseModel
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public bool UseSound
|
||||
{
|
||||
get => Settings.UseSound;
|
||||
|
|
@ -468,29 +472,17 @@ public partial class SettingsPaneThemeViewModel : BaseModel
|
|||
|
||||
public string ThemeImage => Constant.QueryTextBoxIconImagePath;
|
||||
|
||||
public SettingsPaneThemeViewModel(Settings settings)
|
||||
{
|
||||
Settings = settings;
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void OpenThemesFolder()
|
||||
{
|
||||
App.API.OpenDirectory(Path.Combine(DataLocation.DataDirectory(), Constant.Themes));
|
||||
}
|
||||
|
||||
private void UpdateColorScheme()
|
||||
{
|
||||
ThemeManagerForColorSchemeSwitch.Current.ApplicationTheme = Settings.ColorScheme switch
|
||||
{
|
||||
Infrastructure.UserSettings.ColorSchemes.Light => ApplicationTheme.Light,
|
||||
Infrastructure.UserSettings.ColorSchemes.Dark => ApplicationTheme.Dark,
|
||||
Infrastructure.UserSettings.ColorSchemes.System => null,
|
||||
_ => ThemeManagerForColorSchemeSwitch.Current.ApplicationTheme
|
||||
};
|
||||
ThemeManager.Instance.RefreshFrame();
|
||||
}
|
||||
|
||||
public SettingsPaneThemeViewModel(Settings settings)
|
||||
{
|
||||
Settings = settings;
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
public void Reset()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue