mirror of
https://github.com/yattee/yattee.git
synced 2026-07-20 14:22:02 +00:00
Add card style option for Home shortcut cards
Adds a Style picker (Plain / Accent / Colorful) to the Customize Home sheet, shown when the shortcuts layout is Cards. Defaults to Plain. - Plain: current look (light accent tint + accent border) - Accent: solid accent fill, white icon/text - Colorful: solid fill with a fixed color per shortcut type The filled styles use a Reminders-style layout (icon top-leading, count top-trailing, title anchored to the bottom) with a subtle gradient sheen over the fill color. Cards without a meaningful count (Open Link, Remote, Subscriptions, instance content, media sources) hide the number; Remote shows its status dot in the top-right slot instead. Persisted via SettingsKey.homeShortcutCardStyle, mirroring the existing homeShortcutLayout accessor.
This commit is contained in:
@@ -64,6 +64,7 @@ enum SettingsKey: String, CaseIterable {
|
||||
case homeShortcutOrder
|
||||
case homeShortcutVisibility
|
||||
case homeShortcutLayout
|
||||
case homeShortcutCardStyle
|
||||
case homeSectionOrder
|
||||
case homeSectionVisibility
|
||||
case homeSectionItemsLimit
|
||||
@@ -135,7 +136,7 @@ enum SettingsKey: String, CaseIterable {
|
||||
switch self {
|
||||
case .preferredQuality, .cellularQuality, .allowSoftwareDecodedFormats, .macPlayerMode, .listStyle,
|
||||
// Home layout — different UI paradigms per platform
|
||||
.homeShortcutOrder, .homeShortcutVisibility, .homeShortcutLayout,
|
||||
.homeShortcutOrder, .homeShortcutVisibility, .homeShortcutLayout, .homeShortcutCardStyle,
|
||||
.homeSectionOrder, .homeSectionVisibility, .homeSectionItemsLimit, .homeSectionLayout,
|
||||
// Top Shelf — tvOS only
|
||||
.topShelfSections,
|
||||
|
||||
@@ -95,6 +95,21 @@ extension SettingsManager {
|
||||
}
|
||||
}
|
||||
|
||||
/// Visual style for home shortcut cards (plain, accent-filled, or colorful). Default is plain.
|
||||
var homeShortcutCardStyle: HomeShortcutCardStyle {
|
||||
get {
|
||||
if let cached = _homeShortcutCardStyle { return cached }
|
||||
guard let rawValue = string(for: .homeShortcutCardStyle) else {
|
||||
return .plain
|
||||
}
|
||||
return HomeShortcutCardStyle(rawValue: rawValue) ?? .plain
|
||||
}
|
||||
set {
|
||||
_homeShortcutCardStyle = newValue
|
||||
set(newValue.rawValue, for: .homeShortcutCardStyle)
|
||||
}
|
||||
}
|
||||
|
||||
/// Layout mode for home sections (list or grid). Default is list on iOS/macOS, grid on tvOS.
|
||||
var homeSectionLayout: HomeSectionLayout {
|
||||
get {
|
||||
|
||||
@@ -108,6 +108,7 @@ final class SettingsManager {
|
||||
var _homeShortcutOrder: [HomeShortcutItem]?
|
||||
var _homeShortcutVisibility: [HomeShortcutItem: Bool]?
|
||||
var _homeShortcutLayout: HomeShortcutLayout?
|
||||
var _homeShortcutCardStyle: HomeShortcutCardStyle?
|
||||
var _homeSectionOrder: [HomeSectionItem]?
|
||||
var _homeSectionVisibility: [HomeSectionItem: Bool]?
|
||||
var _homeSectionItemsLimit: Int?
|
||||
@@ -463,6 +464,7 @@ final class SettingsManager {
|
||||
_homeShortcutOrder = nil
|
||||
_homeShortcutVisibility = nil
|
||||
_homeShortcutLayout = nil
|
||||
_homeShortcutCardStyle = nil
|
||||
_homeSectionOrder = nil
|
||||
_homeSectionVisibility = nil
|
||||
_homeSectionItemsLimit = nil
|
||||
|
||||
Reference in New Issue
Block a user