mirror of
https://github.com/yattee/yattee.git
synced 2026-06-04 22:04:19 +00:00
Add List/Grid layout option for Home sections
Introduces a "Display sections as" picker in Home settings with List and Grid modes. Grid renders each section as a horizontal shelf of video cards, defaulting to Grid on tvOS and List on iOS/macOS. Per-platform defaults are preserved via a platform-specific settings key. On tvOS the shelf is a focus section so swiping up/down between rows of different lengths works without getting stuck at the end of a row.
This commit is contained in:
@@ -30,6 +30,36 @@ enum HomeShortcutLayout: String, CaseIterable, Sendable {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Home Section Layout
|
||||
|
||||
/// Layout mode for the configurable home sections (Continue Watching, Feed, etc.).
|
||||
enum HomeSectionLayout: String, CaseIterable, Sendable {
|
||||
case list
|
||||
case grid
|
||||
|
||||
var displayName: LocalizedStringKey {
|
||||
switch self {
|
||||
case .list: return "home.sections.layout.list"
|
||||
case .grid: return "home.sections.layout.grid"
|
||||
}
|
||||
}
|
||||
|
||||
var systemImage: String {
|
||||
switch self {
|
||||
case .list: return "list.bullet"
|
||||
case .grid: return "square.grid.2x2"
|
||||
}
|
||||
}
|
||||
|
||||
static var platformDefault: HomeSectionLayout {
|
||||
#if os(tvOS)
|
||||
return .grid
|
||||
#else
|
||||
return .list
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Instance Content Type
|
||||
|
||||
/// Content type for instance home items.
|
||||
|
||||
Reference in New Issue
Block a user