Use List instead of Form for View Options on tvOS

Form inside a sheet causes clipped rows and invisible text on focused
items due to white-on-white rendering. Use a plain List on tvOS which
handles the focus styling correctly.
This commit is contained in:
Arkadiusz Fal
2026-04-13 21:42:07 +02:00
parent 310869fad8
commit 84db5d0c42

View File

@@ -33,15 +33,58 @@ struct ViewOptionsSheet: View {
var body: some View { var body: some View {
#if os(tvOS) #if os(tvOS)
NavigationStack { tvOSContent
formContent
}
.padding(.horizontal, 40)
#else #else
formContent formContent
#endif #endif
} }
#if os(tvOS)
private var tvOSContent: some View {
List {
Section {
Picker(selection: $layout) {
ForEach(VideoListLayout.allCases, id: \.self) { option in
Label(option.displayName, systemImage: option.systemImage)
.tag(option)
}
} label: {
Text("viewOptions.layout")
}
.pickerStyle(.segmented)
if layout == .list {
Picker("viewOptions.rowSize", selection: $rowStyle) {
Text("viewOptions.rowSize.compact").tag(VideoRowStyle.compact)
Text("viewOptions.rowSize.regular").tag(VideoRowStyle.regular)
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 {
Toggle("viewOptions.hideWatched", isOn: hideWatched)
}
if let channelStripSize = channelStripSize {
Picker("viewOptions.channelStrip", selection: channelStripSize) {
ForEach(ChannelStripSize.allCases, id: \.self) { size in
Text(size.displayName).tag(size)
}
}
}
}
}
}
#endif
private var formContent: some View { private var formContent: some View {
Form { Form {
// Single section with all options // Single section with all options