1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 22:00:31 +05:30
yattee/Apple TV/ViewOptionsView.swift

44 lines
863 B
Swift
Raw Normal View History

2021-06-27 04:59:55 +05:30
import Defaults
2021-06-26 17:07:24 +05:30
import SwiftUI
struct ViewOptionsView: View {
2021-06-27 04:59:55 +05:30
@Environment(\.dismiss) private var dismiss
@Default(.layout) var layout
2021-06-26 17:07:24 +05:30
var body: some View {
2021-06-27 04:59:55 +05:30
HStack {
2021-06-26 17:07:24 +05:30
VStack {
Spacer()
2021-06-27 04:59:55 +05:30
HStack(alignment: .center) {
Spacer()
VStack {
nextLayoutButton
2021-06-26 17:07:24 +05:30
2021-06-27 04:59:55 +05:30
Button("Close") {
dismiss()
}
2021-06-26 17:07:24 +05:30
}
2021-06-27 04:59:55 +05:30
Spacer()
2021-06-26 17:07:24 +05:30
}
2021-06-27 04:59:55 +05:30
2021-06-26 17:07:24 +05:30
Spacer()
}
2021-06-27 04:59:55 +05:30
Spacer()
2021-06-26 17:07:24 +05:30
}
2021-06-27 04:59:55 +05:30
.background(.thinMaterial)
}
var nextLayoutButton: some View {
Button(layout.next().name, action: nextLayout)
}
func nextLayout() {
Defaults[.layout] = layout.next()
dismiss()
2021-06-26 17:07:24 +05:30
}
}