mirror of
https://github.com/yattee/yattee.git
synced 2025-12-04 07:08:15 +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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user