mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Setting for app tab navigation section
This commit is contained in:
@@ -4,11 +4,18 @@ import SwiftUI
|
||||
struct BrowsingSettings: View {
|
||||
@Default(.channelOnThumbnail) private var channelOnThumbnail
|
||||
@Default(.timeOnThumbnail) private var timeOnThumbnail
|
||||
#if os(iOS)
|
||||
@Default(.tabNavigationSection) private var tabNavigationSection
|
||||
#endif
|
||||
|
||||
var body: some View {
|
||||
Section(header: SettingsHeader(text: "Thumbnails")) {
|
||||
Section(header: SettingsHeader(text: "Browsing"), footer: footer) {
|
||||
Toggle("Display channel names on thumbnails", isOn: $channelOnThumbnail)
|
||||
Toggle("Display video length on thumbnails", isOn: $timeOnThumbnail)
|
||||
|
||||
#if os(iOS)
|
||||
preferredTabPicker
|
||||
#endif
|
||||
}
|
||||
.frame(minWidth: 0, maxWidth: .infinity, alignment: .leading)
|
||||
|
||||
@@ -16,6 +23,23 @@ struct BrowsingSettings: View {
|
||||
Spacer()
|
||||
#endif
|
||||
}
|
||||
|
||||
var footer: some View {
|
||||
#if os(iOS)
|
||||
Text("This tab will be displayed when there is no space to display all tabs")
|
||||
#else
|
||||
EmptyView()
|
||||
#endif
|
||||
}
|
||||
|
||||
#if os(iOS)
|
||||
var preferredTabPicker: some View {
|
||||
Picker("Preferred tab", selection: $tabNavigationSection) {
|
||||
Text("Trending").tag(TabNavigationSectionSetting.trending)
|
||||
Text("Popular").tag(TabNavigationSectionSetting.popular)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
struct BrowsingSettings_Previews: PreviewProvider {
|
||||
|
Reference in New Issue
Block a user