2021-06-26 23:29:55 +00:00
|
|
|
import Defaults
|
2021-06-26 11:37:24 +00:00
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct ViewOptionsView: View {
|
|
|
|
@EnvironmentObject private var profile: Profile
|
|
|
|
|
2021-06-26 23:29:55 +00:00
|
|
|
@Environment(\.dismiss) private var dismiss
|
|
|
|
@Default(.layout) var layout
|
2021-06-26 11:37:24 +00:00
|
|
|
|
|
|
|
var body: some View {
|
2021-06-26 23:29:55 +00:00
|
|
|
HStack {
|
2021-06-26 11:37:24 +00:00
|
|
|
VStack {
|
|
|
|
Spacer()
|
|
|
|
|
2021-06-26 23:29:55 +00:00
|
|
|
HStack(alignment: .center) {
|
|
|
|
Spacer()
|
|
|
|
|
|
|
|
VStack {
|
|
|
|
nextLayoutButton
|
2021-06-26 11:37:24 +00:00
|
|
|
|
2021-06-26 23:29:55 +00:00
|
|
|
Button("Close") {
|
|
|
|
dismiss()
|
|
|
|
}
|
2021-06-26 11:37:24 +00:00
|
|
|
}
|
2021-06-26 23:29:55 +00:00
|
|
|
|
|
|
|
Spacer()
|
2021-06-26 11:37:24 +00:00
|
|
|
}
|
2021-06-26 23:29:55 +00:00
|
|
|
|
2021-06-26 11:37:24 +00:00
|
|
|
Spacer()
|
|
|
|
}
|
2021-06-26 23:29:55 +00:00
|
|
|
|
|
|
|
Spacer()
|
2021-06-26 11:37:24 +00:00
|
|
|
}
|
2021-06-26 23:29:55 +00:00
|
|
|
.background(.thinMaterial)
|
|
|
|
}
|
|
|
|
|
|
|
|
var nextLayoutButton: some View {
|
|
|
|
Button(layout.next().name, action: nextLayout)
|
|
|
|
}
|
|
|
|
|
|
|
|
func nextLayout() {
|
|
|
|
Defaults[.layout] = layout.next()
|
|
|
|
dismiss()
|
2021-06-26 11:37:24 +00:00
|
|
|
}
|
|
|
|
}
|