mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Re-add updating color scheme right after it changed
This commit is contained in:
parent
a0f4386794
commit
914219324a
3 changed files with 23 additions and 2 deletions
|
|
@ -13,6 +13,9 @@ using Flow.Launcher.Infrastructure;
|
|||
using Flow.Launcher.Infrastructure.UserSettings;
|
||||
using Flow.Launcher.Plugin;
|
||||
using Flow.Launcher.ViewModel;
|
||||
using ModernWpf;
|
||||
using ThemeManager = Flow.Launcher.Core.Resource.ThemeManager;
|
||||
using ThemeManagerForColorSchemeSwitch = ModernWpf.ThemeManager;
|
||||
|
||||
namespace Flow.Launcher.SettingPages.ViewModels;
|
||||
|
||||
|
|
@ -371,6 +374,17 @@ public partial class SettingsPaneThemeViewModel : BaseModel
|
|||
App.API.OpenDirectory(Path.Combine(DataLocation.DataDirectory(), Constant.Themes));
|
||||
}
|
||||
|
||||
public void UpdateColorScheme()
|
||||
{
|
||||
ThemeManagerForColorSchemeSwitch.Current.ApplicationTheme = Settings.ColorScheme switch
|
||||
{
|
||||
Constant.Light => ApplicationTheme.Light,
|
||||
Constant.Dark => ApplicationTheme.Dark,
|
||||
Constant.System => null,
|
||||
_ => ThemeManagerForColorSchemeSwitch.Current.ApplicationTheme
|
||||
};
|
||||
}
|
||||
|
||||
public SettingsPaneThemeViewModel(Settings settings)
|
||||
{
|
||||
Settings = settings;
|
||||
|
|
|
|||
|
|
@ -469,7 +469,8 @@
|
|||
FontSize="14"
|
||||
ItemsSource="{Binding ColorSchemes}"
|
||||
SelectedValue="{Binding Settings.ColorScheme}"
|
||||
SelectedValuePath="Value" />
|
||||
SelectedValuePath="Value"
|
||||
SelectionChanged="Selector_OnSelectionChanged"/>
|
||||
</cc:Card>
|
||||
|
||||
<!-- Theme folder -->
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
using System;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Navigation;
|
||||
using Flow.Launcher.SettingPages.ViewModels;
|
||||
using ModernWpf.Controls;
|
||||
using Page = ModernWpf.Controls.Page;
|
||||
|
||||
namespace Flow.Launcher.SettingPages.Views;
|
||||
|
||||
|
|
@ -22,4 +23,9 @@ public partial class SettingsPaneTheme : Page
|
|||
|
||||
base.OnNavigatedTo(e);
|
||||
}
|
||||
|
||||
private void Selector_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
_viewModel.UpdateColorScheme();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue