settings_re7

This commit is contained in:
lincube
2026-03-14 16:38:56 +08:00
parent 8d4f00efcb
commit 91f9f3d6fb
14 changed files with 370 additions and 60 deletions

View File

@@ -15,7 +15,7 @@ public enum WallpaperMediaType
}
public sealed record GridSettingsState(int ShortSideCells, string SpacingPreset, int EdgeInsetPercent);
public sealed record WallpaperSettingsState(string? WallpaperPath, string Placement);
public sealed record WallpaperSettingsState(string? WallpaperPath, string Type, string? Color, string Placement);
public sealed record ThemeAppearanceSettingsState(bool IsNightMode, string? ThemeColor, bool UseSystemChrome);
public sealed record StatusBarSettingsState(
IReadOnlyList<string> TopStatusComponentIds,

View File

@@ -91,13 +91,19 @@ internal sealed class WallpaperSettingsService : IWallpaperSettingsService
public WallpaperSettingsState Get()
{
var snapshot = _settingsService.Load();
return new WallpaperSettingsState(snapshot.WallpaperPath, snapshot.WallpaperPlacement);
return new WallpaperSettingsState(
snapshot.WallpaperPath,
snapshot.WallpaperType ?? "Image",
snapshot.WallpaperColor,
snapshot.WallpaperPlacement);
}
public void Save(WallpaperSettingsState state)
{
var snapshot = _settingsService.Load();
snapshot.WallpaperPath = state.WallpaperPath;
snapshot.WallpaperType = state.Type;
snapshot.WallpaperColor = state.Color;
snapshot.WallpaperPlacement = string.IsNullOrWhiteSpace(state.Placement)
? "Fill"
: state.Placement.Trim();
@@ -107,6 +113,8 @@ internal sealed class WallpaperSettingsService : IWallpaperSettingsService
changedKeys:
[
nameof(AppSettingsSnapshot.WallpaperPath),
nameof(AppSettingsSnapshot.WallpaperType),
nameof(AppSettingsSnapshot.WallpaperColor),
nameof(AppSettingsSnapshot.WallpaperPlacement)
]);
}