Merge branch '250223FluentTest2' of https://github.com/onesounds/Flow.Launcher into 250223FluentTest2

This commit is contained in:
DB p 2025-03-14 17:44:35 +09:00
commit 887be640c9
3 changed files with 29 additions and 35 deletions

View file

@ -15,8 +15,6 @@ using Flow.Launcher.ViewModel;
using ModernWpf;
using ThemeManager = Flow.Launcher.Core.Resource.ThemeManager;
using ThemeManagerForColorSchemeSwitch = ModernWpf.ThemeManager;
using static Flow.Launcher.Core.Resource.Theme;
using System.Windows.Interop;
namespace Flow.Launcher.SettingPages.ViewModels;
@ -38,8 +36,11 @@ public partial class SettingsPaneThemeViewModel : BaseModel
ThemeManager.Instance.ChangeTheme(value.FileNameWithoutExtension);
if (ThemeManager.Instance.BlurEnabled && Settings.UseDropShadowEffect == false)
{
DropShadowEffect = true;
OnPropertyChanged(nameof(IsDropShadowEnabled));
}
ThemeManager.Instance.RefreshFrame();
//ThemeManager.Instance.SetBlurForWindow();
}
@ -107,6 +108,24 @@ public partial class SettingsPaneThemeViewModel : BaseModel
public class ColorSchemeData : DropdownDataGeneric<ColorSchemes> { }
public List<ColorSchemeData> ColorSchemes { get; } = DropdownDataGeneric<ColorSchemes>.GetValues<ColorSchemeData>("ColorScheme");
public string ColorScheme
{
get => Settings.ColorScheme;
set
{
ThemeManagerForColorSchemeSwitch.Current.ApplicationTheme = value switch
{
Constant.Light => ApplicationTheme.Light,
Constant.Dark => ApplicationTheme.Dark,
Constant.System => null,
_ => ThemeManagerForColorSchemeSwitch.Current.ApplicationTheme
};
ThemeManager.Instance.RefreshFrame();
Settings.ColorScheme = value;
}
}
public List<string> TimeFormatList { get; } = new()
{
@ -209,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))
@ -230,9 +248,6 @@ public partial class SettingsPaneThemeViewModel : BaseModel
}
}
public bool UseSound
{
get => Settings.UseSound;
@ -457,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));
}
public void UpdateColorScheme()
{
ThemeManagerForColorSchemeSwitch.Current.ApplicationTheme = Settings.ColorScheme switch
{
Constant.Light => ApplicationTheme.Light,
Constant.Dark => ApplicationTheme.Dark,
Constant.System => null,
_ => ThemeManagerForColorSchemeSwitch.Current.ApplicationTheme
};
ThemeManager.Instance.RefreshFrame();
}
public SettingsPaneThemeViewModel(Settings settings)
{
Settings = settings;
}
[RelayCommand]
public void Reset()
{

View file

@ -688,9 +688,8 @@
DisplayMemberPath="Display"
FontSize="14"
ItemsSource="{Binding ColorSchemes}"
SelectedValue="{Binding Settings.ColorScheme}"
SelectedValuePath="Value"
SelectionChanged="Selector_OnSelectionChanged" />
SelectedValue="{Binding ColorScheme, Mode=TwoWay}"
SelectedValuePath="Value" />
</cc:Card>
<!-- Theme folder -->

View file

@ -1,7 +1,4 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Navigation;
using Flow.Launcher.SettingPages.ViewModels;
using Page = ModernWpf.Controls.Page;
@ -25,9 +22,4 @@ public partial class SettingsPaneTheme : Page
base.OnNavigatedTo(e);
}
private void Selector_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
_viewModel.UpdateColorScheme();
}
}