Split home shortcut card style into Layout, Color, and Palette

Decouple the two concerns that were entangled in a single card-style setting:

- Layout (Compact / Regular) now only controls positioning of the
  icon / title / subtitle / counter.
- Color (Soft / Vibrant) is a new independent setting: Soft = tinted
  background with palette-colored icon and neutral text; Vibrant =
  solid palette fill with white icon/text.
- Palette (Accent first, then Classic/Sunset/Meadow/Berry/Grape/Custom)
  now applies to both layouts and both colors, and is always shown.

Adds section headers (Layout / Color / Palette) to the style page and
fixes the Compact preview to show the count subtitle line. Default is
Regular + Soft + Accent.
This commit is contained in:
Arkadiusz Fal
2026-06-11 19:03:52 +02:00
parent 30fc8dc4c8
commit 8d556abd0b
9 changed files with 252 additions and 81 deletions

View File

@@ -66,6 +66,7 @@ enum SettingsKey: String, CaseIterable {
case homeShortcutVisibility
case homeShortcutLayout
case homeShortcutCardStyle
case homeShortcutCardColor
case homeShortcutColorfulPalette
case homeShortcutCustomPaletteColors
case homeSectionOrder
@@ -141,7 +142,7 @@ enum SettingsKey: String, CaseIterable {
.macPlayerSeparateWindow, .macPlayerFloating, .listStyle,
// Home layout different UI paradigms per platform
.homeShortcutOrder, .homeShortcutVisibility, .homeShortcutLayout, .homeShortcutCardStyle,
.homeShortcutColorfulPalette, .homeShortcutCustomPaletteColors,
.homeShortcutCardColor, .homeShortcutColorfulPalette, .homeShortcutCustomPaletteColors,
.homeSectionOrder, .homeSectionVisibility, .homeSectionItemsLimit, .homeSectionLayout,
// Top Shelf tvOS only
.topShelfSections,

View File

@@ -95,14 +95,14 @@ extension SettingsManager {
}
}
/// Visual style for home shortcut cards (plain, accent-filled, or colorful). Default is plain.
/// Layout for home shortcut cards (compact or regular). Default is regular.
var homeShortcutCardStyle: HomeShortcutCardStyle {
get {
if let cached = _homeShortcutCardStyle { return cached }
guard let rawValue = string(for: .homeShortcutCardStyle) else {
return .plain
return .regular
}
return HomeShortcutCardStyle(rawValue: rawValue) ?? .plain
return HomeShortcutCardStyle(rawValue: rawValue) ?? .regular
}
set {
_homeShortcutCardStyle = newValue
@@ -110,15 +110,31 @@ extension SettingsManager {
}
}
/// Palette used by the "colorful" card style. Colors are applied by grid
/// position. Default is Classic.
/// Color emphasis for home shortcut cards (soft or vibrant), independent of
/// the layout style. Default is soft.
var homeShortcutCardColor: HomeShortcutCardColor {
get {
if let cached = _homeShortcutCardColor { return cached }
guard let rawValue = string(for: .homeShortcutCardColor) else {
return .soft
}
return HomeShortcutCardColor(rawValue: rawValue) ?? .soft
}
set {
_homeShortcutCardColor = newValue
set(newValue.rawValue, for: .homeShortcutCardColor)
}
}
/// Palette used by the "regular" card style. Colors are applied by grid
/// position. Default is Accent (the first palette option).
var homeShortcutColorfulPalette: HomeShortcutColorfulPalette {
get {
if let cached = _homeShortcutColorfulPalette { return cached }
guard let rawValue = string(for: .homeShortcutColorfulPalette) else {
return .classic
return .accent
}
return HomeShortcutColorfulPalette(rawValue: rawValue) ?? .classic
return HomeShortcutColorfulPalette(rawValue: rawValue) ?? .accent
}
set {
_homeShortcutColorfulPalette = newValue

View File

@@ -110,6 +110,7 @@ final class SettingsManager {
var _homeShortcutVisibility: [HomeShortcutItem: Bool]?
var _homeShortcutLayout: HomeShortcutLayout?
var _homeShortcutCardStyle: HomeShortcutCardStyle?
var _homeShortcutCardColor: HomeShortcutCardColor?
var _homeShortcutColorfulPalette: HomeShortcutColorfulPalette?
var _homeShortcutCustomPaletteColors: [String]?
var _homeSectionOrder: [HomeSectionItem]?
@@ -469,6 +470,7 @@ final class SettingsManager {
_homeShortcutVisibility = nil
_homeShortcutLayout = nil
_homeShortcutCardStyle = nil
_homeShortcutCardColor = nil
_homeShortcutColorfulPalette = nil
_homeShortcutCustomPaletteColors = nil
_homeSectionOrder = nil