2021-07-08 04:09:18 +05:30
|
|
|
import Defaults
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct OptionsView: View {
|
2021-09-25 13:48:22 +05:30
|
|
|
@EnvironmentObject<NavigationModel> private var navigation
|
2021-07-08 04:09:18 +05:30
|
|
|
|
|
|
|
@Default(.layout) private var layout
|
2021-07-12 02:22:49 +05:30
|
|
|
|
|
|
|
@Environment(\.dismiss) private var dismiss
|
2021-07-08 04:09:18 +05:30
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
HStack {
|
|
|
|
VStack {
|
|
|
|
HStack {
|
|
|
|
Spacer()
|
|
|
|
|
|
|
|
VStack(alignment: .leading) {
|
|
|
|
Spacer()
|
|
|
|
|
2021-07-08 20:44:54 +05:30
|
|
|
CoverSectionView("View Options") {
|
|
|
|
CoverSectionRowView("Show videos as") { nextLayoutButton }
|
2021-07-08 04:09:18 +05:30
|
|
|
}
|
|
|
|
|
2021-07-08 20:44:54 +05:30
|
|
|
CoverSectionView(divider: false) {
|
|
|
|
CoverSectionRowView("Close View Options") { Button("Close") { dismiss() } }
|
2021-07-08 04:09:18 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
Spacer()
|
2021-09-25 13:48:22 +05:30
|
|
|
|
|
|
|
SettingsView()
|
2021-07-08 04:09:18 +05:30
|
|
|
}
|
|
|
|
.frame(maxWidth: 800)
|
|
|
|
|
|
|
|
Spacer()
|
|
|
|
}
|
|
|
|
|
|
|
|
Spacer()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.background(.thinMaterial)
|
|
|
|
}
|
|
|
|
|
|
|
|
var nextLayoutButton: some View {
|
|
|
|
Button(layout.name) {
|
|
|
|
self.layout = layout.next()
|
|
|
|
}
|
|
|
|
.contextMenu {
|
|
|
|
ForEach(ListingLayout.allCases) { layout in
|
|
|
|
Button(layout.name) {
|
|
|
|
Defaults[.layout] = layout
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct OptionsView_Previews: PreviewProvider {
|
|
|
|
static var previews: some View {
|
|
|
|
OptionsView()
|
|
|
|
}
|
|
|
|
}
|