mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Convert SelectedTheme from string to record
This commit is contained in:
parent
aedb2d4227
commit
4dcb35ee24
2 changed files with 6 additions and 5 deletions
|
|
@ -27,12 +27,14 @@ public partial class SettingsPaneThemeViewModel : BaseModel
|
|||
public static string LinkHowToCreateTheme => @"https://flowlauncher.com/docs/#/how-to-create-a-theme";
|
||||
public static string LinkThemeGallery => "https://github.com/Flow-Launcher/Flow.Launcher/discussions/1438";
|
||||
|
||||
public string SelectedTheme
|
||||
private Theme.ThemeData _selectedTheme;
|
||||
public Theme.ThemeData SelectedTheme
|
||||
{
|
||||
get => Settings.Theme;
|
||||
get => _selectedTheme ??= Themes.Find(v => v.FileNameWithoutExtension == Settings.Theme);
|
||||
set
|
||||
{
|
||||
ThemeManager.Instance.ChangeTheme(value);
|
||||
_selectedTheme = value;
|
||||
ThemeManager.Instance.ChangeTheme(value.FileNameWithoutExtension);
|
||||
|
||||
if (ThemeManager.Instance.BlurEnabled && Settings.UseDropShadowEffect)
|
||||
DropShadowEffect = false;
|
||||
|
|
|
|||
|
|
@ -401,8 +401,7 @@
|
|||
ItemsSource="{Binding Themes}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
SelectedValue="{Binding SelectedTheme}"
|
||||
SelectedValuePath="FileNameWithoutExtension">
|
||||
SelectedValue="{Binding SelectedTheme}">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel />
|
||||
|
|
|
|||
Loading…
Reference in a new issue