mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-20 23:54:26 +08:00
settings_re7
This commit is contained in:
@@ -412,6 +412,19 @@ public sealed partial class AppearanceSettingsPageViewModel : ViewModelBase
|
||||
[ObservableProperty]
|
||||
private string _themeColor = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private Color _themeColorPickerValue;
|
||||
|
||||
partial void OnThemeColorPickerValueChanged(Color value)
|
||||
{
|
||||
if (_isInitializing)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ThemeColor = value.ToString();
|
||||
}
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _useSystemChrome;
|
||||
|
||||
@@ -474,6 +487,14 @@ public sealed partial class AppearanceSettingsPageViewModel : ViewModelBase
|
||||
var theme = _settingsFacade.Theme.Get();
|
||||
IsNightMode = theme.IsNightMode;
|
||||
ThemeColor = theme.ThemeColor ?? string.Empty;
|
||||
if (Color.TryParse(ThemeColor, out var color))
|
||||
{
|
||||
ThemeColorPickerValue = color;
|
||||
}
|
||||
else
|
||||
{
|
||||
ThemeColorPickerValue = Color.Parse("#FF3B82F6");
|
||||
}
|
||||
UseSystemChrome = theme.UseSystemChrome;
|
||||
|
||||
var wallpaper = _settingsFacade.Wallpaper.Get();
|
||||
@@ -588,8 +609,11 @@ public sealed partial class AppearanceSettingsPageViewModel : ViewModelBase
|
||||
|
||||
private void SaveWallpaper()
|
||||
{
|
||||
var current = _settingsFacade.Wallpaper.Get();
|
||||
_settingsFacade.Wallpaper.Save(new WallpaperSettingsState(
|
||||
string.IsNullOrWhiteSpace(WallpaperPath) ? null : WallpaperPath,
|
||||
current.Type,
|
||||
current.Color,
|
||||
SelectedWallpaperPlacement.Value));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user