mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Settings for thumbnails details
This commit is contained in:
26
Shared/Settings/BrowsingSettings.swift
Normal file
26
Shared/Settings/BrowsingSettings.swift
Normal file
@@ -0,0 +1,26 @@
|
||||
import Defaults
|
||||
import SwiftUI
|
||||
|
||||
struct BrowsingSettings: View {
|
||||
@Default(.channelOnThumbnail) private var channelOnThumbnail
|
||||
@Default(.timeOnThumbnail) private var timeOnThumbnail
|
||||
|
||||
var body: some View {
|
||||
Section(header: SettingsHeader(text: "Thumbnails")) {
|
||||
Toggle("Display channel names on thumbnails", isOn: $channelOnThumbnail)
|
||||
Toggle("Display video length on thumbnails", isOn: $timeOnThumbnail)
|
||||
}
|
||||
.frame(minWidth: 0, maxWidth: .infinity, alignment: .leading)
|
||||
|
||||
#if os(macOS)
|
||||
Spacer()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
struct BrowsingSettings_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
BrowsingSettings()
|
||||
.injectFixtureEnvironmentObjects()
|
||||
}
|
||||
}
|
@@ -5,7 +5,7 @@ import SwiftUI
|
||||
struct SettingsView: View {
|
||||
#if os(macOS)
|
||||
private enum Tabs: Hashable {
|
||||
case instances, playback, services
|
||||
case instances, browsing, playback, services
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -24,6 +24,14 @@ struct SettingsView: View {
|
||||
}
|
||||
.tag(Tabs.instances)
|
||||
|
||||
Form {
|
||||
BrowsingSettings()
|
||||
}
|
||||
.tabItem {
|
||||
Label("Browsing", systemImage: "list.and.film")
|
||||
}
|
||||
.tag(Tabs.browsing)
|
||||
|
||||
Form {
|
||||
PlaybackSettings()
|
||||
}
|
||||
@@ -49,6 +57,7 @@ struct SettingsView: View {
|
||||
AccountSelectionView()
|
||||
#endif
|
||||
InstancesSettings()
|
||||
BrowsingSettings()
|
||||
PlaybackSettings()
|
||||
ServicesSettings()
|
||||
}
|
||||
@@ -69,7 +78,7 @@ struct SettingsView: View {
|
||||
#endif
|
||||
}
|
||||
#if os(tvOS)
|
||||
.background(.thickMaterial)
|
||||
.background(.black)
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user