mirror of
https://github.com/yattee/yattee.git
synced 2024-12-13 22:00:31 +05:30
44 lines
863 B
Swift
44 lines
863 B
Swift
import Defaults
|
|
import SwiftUI
|
|
|
|
struct ViewOptionsView: View {
|
|
@Environment(\.dismiss) private var dismiss
|
|
@Default(.layout) var layout
|
|
|
|
var body: some View {
|
|
HStack {
|
|
VStack {
|
|
Spacer()
|
|
|
|
HStack(alignment: .center) {
|
|
Spacer()
|
|
|
|
VStack {
|
|
nextLayoutButton
|
|
|
|
Button("Close") {
|
|
dismiss()
|
|
}
|
|
}
|
|
|
|
Spacer()
|
|
}
|
|
|
|
Spacer()
|
|
}
|
|
|
|
Spacer()
|
|
}
|
|
.background(.thinMaterial)
|
|
}
|
|
|
|
var nextLayoutButton: some View {
|
|
Button(layout.next().name, action: nextLayout)
|
|
}
|
|
|
|
func nextLayout() {
|
|
Defaults[.layout] = layout.next()
|
|
dismiss()
|
|
}
|
|
}
|