mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Setting for player sidebar
This commit is contained in:
@@ -3,6 +3,13 @@ import SwiftUI
|
||||
|
||||
struct PlaybackSettings: View {
|
||||
@Default(.quality) private var quality
|
||||
@Default(.playerSidebar) private var playerSidebar
|
||||
|
||||
#if os(iOS)
|
||||
private var idiom: UIUserInterfaceIdiom {
|
||||
UIDevice.current.userInterfaceIdiom
|
||||
}
|
||||
#endif
|
||||
|
||||
var body: some View {
|
||||
Section(header: Text("Quality")) {
|
||||
@@ -18,9 +25,40 @@ struct PlaybackSettings: View {
|
||||
#elseif os(tvOS)
|
||||
.pickerStyle(.inline)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if os(macOS)
|
||||
Spacer()
|
||||
#if os(iOS)
|
||||
if idiom == .pad {
|
||||
playerSidebarSection
|
||||
}
|
||||
#elseif os(macOS)
|
||||
playerSidebarSection
|
||||
#endif
|
||||
|
||||
#if os(macOS)
|
||||
Spacer()
|
||||
#endif
|
||||
}
|
||||
|
||||
private var playerSidebarSection: some View {
|
||||
Section(header: Text("Player Sidebar")) {
|
||||
Picker("Player Sidebar", selection: $playerSidebar) {
|
||||
#if os(macOS)
|
||||
Text("Show").tag(PlayerSidebarSetting.always)
|
||||
#endif
|
||||
|
||||
#if os(iOS)
|
||||
Text("Show when space permits").tag(PlayerSidebarSetting.whenFits)
|
||||
#endif
|
||||
|
||||
Text("Hide").tag(PlayerSidebarSetting.never)
|
||||
}
|
||||
.labelsHidden()
|
||||
|
||||
#if os(iOS)
|
||||
.pickerStyle(.automatic)
|
||||
#elseif os(tvOS)
|
||||
.pickerStyle(.inline)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@ import SwiftUI
|
||||
struct SettingsView: View {
|
||||
#if os(macOS)
|
||||
private enum Tabs: Hashable {
|
||||
case playback, services, instances
|
||||
case instances, playback, services
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -24,14 +24,6 @@ struct SettingsView: View {
|
||||
}
|
||||
.tag(Tabs.instances)
|
||||
|
||||
Form {
|
||||
ServicesSettings()
|
||||
}
|
||||
.tabItem {
|
||||
Label("Services", systemImage: "puzzlepiece.extension")
|
||||
}
|
||||
.tag(Tabs.services)
|
||||
|
||||
Form {
|
||||
PlaybackSettings()
|
||||
}
|
||||
@@ -39,6 +31,14 @@ struct SettingsView: View {
|
||||
Label("Playback", systemImage: "play.rectangle.on.rectangle.fill")
|
||||
}
|
||||
.tag(Tabs.playback)
|
||||
|
||||
Form {
|
||||
ServicesSettings()
|
||||
}
|
||||
.tabItem {
|
||||
Label("Services", systemImage: "puzzlepiece.extension")
|
||||
}
|
||||
.tag(Tabs.services)
|
||||
}
|
||||
.padding(20)
|
||||
.frame(width: 400, height: 310)
|
||||
@@ -49,8 +49,8 @@ struct SettingsView: View {
|
||||
AccountSelectionView()
|
||||
#endif
|
||||
InstancesSettings()
|
||||
ServicesSettings()
|
||||
PlaybackSettings()
|
||||
ServicesSettings()
|
||||
}
|
||||
.navigationTitle("Settings")
|
||||
.toolbar {
|
||||
|
Reference in New Issue
Block a user