mirror of
https://github.com/yattee/yattee.git
synced 2026-05-12 02:17:46 +00:00
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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user