mirror of
https://github.com/yattee/yattee.git
synced 2026-05-12 10:25:02 +00:00
Wrap View Options sheet in NavigationStack on tvOS for picker labels
The .pickerStyle(.menu) hid labels. Instead, wrap the Form in a NavigationStack on tvOS so the default navigation picker style works and shows both labels and values.
This commit is contained in:
@@ -32,6 +32,16 @@ struct ViewOptionsSheet: View {
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
#if os(tvOS)
|
||||
NavigationStack {
|
||||
formContent
|
||||
}
|
||||
#else
|
||||
formContent
|
||||
#endif
|
||||
}
|
||||
|
||||
private var formContent: some View {
|
||||
Form {
|
||||
// Single section with all options
|
||||
Section {
|
||||
@@ -55,9 +65,6 @@ struct ViewOptionsSheet: View {
|
||||
Text("viewOptions.rowSize.regular").tag(VideoRowStyle.regular)
|
||||
Text("viewOptions.rowSize.large").tag(VideoRowStyle.large)
|
||||
}
|
||||
#if os(tvOS)
|
||||
.pickerStyle(.menu)
|
||||
#endif
|
||||
}
|
||||
|
||||
// Grid-specific options
|
||||
@@ -68,7 +75,6 @@ struct ViewOptionsSheet: View {
|
||||
Text("\(count)").tag(count)
|
||||
}
|
||||
}
|
||||
.pickerStyle(.menu)
|
||||
#else
|
||||
Stepper(
|
||||
"viewOptions.columns \(effectiveColumns)",
|
||||
@@ -90,9 +96,6 @@ struct ViewOptionsSheet: View {
|
||||
Text(size.displayName).tag(size)
|
||||
}
|
||||
}
|
||||
#if os(tvOS)
|
||||
.pickerStyle(.menu)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user