Fix tvOS view options sheet rendering in History and other views

This commit is contained in:
Arkadiusz Fal
2026-04-17 04:17:47 +02:00
parent a660591e8d
commit 546ecf632e

View File

@@ -41,50 +41,54 @@ struct ViewOptionsSheet: View {
#if os(tvOS) #if os(tvOS)
private var tvOSContent: some View { private var tvOSContent: some View {
List { NavigationStack {
Section { List {
Picker(selection: $layout) { Section {
ForEach(VideoListLayout.allCases, id: \.self) { option in Picker(selection: $layout) {
Label(option.displayName, systemImage: option.systemImage) ForEach(VideoListLayout.allCases, id: \.self) { option in
.tag(option) Label(option.displayName, systemImage: option.systemImage)
.tag(option)
}
} label: {
Text("viewOptions.layout")
} }
} label: { .pickerStyle(.segmented)
Text("viewOptions.layout")
}
.pickerStyle(.segmented)
if layout == .list { if layout == .list {
Picker("viewOptions.rowSize", selection: $rowStyle) { Picker("viewOptions.rowSize", selection: $rowStyle) {
Text("viewOptions.rowSize.compact").tag(VideoRowStyle.compact) Text("viewOptions.rowSize.compact").tag(VideoRowStyle.compact)
Text("viewOptions.rowSize.regular").tag(VideoRowStyle.regular) Text("viewOptions.rowSize.regular").tag(VideoRowStyle.regular)
Text("viewOptions.rowSize.large").tag(VideoRowStyle.large) Text("viewOptions.rowSize.large").tag(VideoRowStyle.large)
}
}
if layout == .grid {
Picker("viewOptions.columns.header", selection: $gridColumns) {
ForEach(1...maxGridColumns, id: \.self) { count in
Text("\(count)").tag(count)
} }
} }
}
if let hideWatched = hideWatched { if layout == .grid {
Toggle("viewOptions.hideWatched", isOn: hideWatched) Picker("viewOptions.columns.header", selection: $gridColumns) {
} ForEach(1...maxGridColumns, id: \.self) { count in
Text("\(count)").tag(count)
}
}
}
if let channelStripSize = channelStripSize { if let hideWatched = hideWatched {
Picker("viewOptions.channelStrip", selection: channelStripSize) { Toggle("viewOptions.hideWatched", isOn: hideWatched)
ForEach(ChannelStripSize.allCases, id: \.self) { size in }
Text(size.displayName).tag(size)
if let channelStripSize = channelStripSize {
Picker("viewOptions.channelStrip", selection: channelStripSize) {
ForEach(ChannelStripSize.allCases, id: \.self) { size in
Text(size.displayName).tag(size)
}
} }
} }
} }
} }
.scrollClipDisabled()
.padding(.horizontal, 40)
.padding(.vertical, 24)
} }
.scrollClipDisabled() .presentationDetents([.height(360), .large])
.padding(.horizontal, 40) .presentationDragIndicator(.visible)
.padding(.vertical, 24)
} }
#endif #endif