adwaita-swift/Tests/DialogDemo.swift
2024-05-06 16:18:49 +02:00

41 lines
796 B
Swift

//
// DialogDemo.swift
// Adwaita
//
// Created by david-swift on 20.13.24.
//
// swiftlint:disable missing_docs
import Adwaita
struct DialogDemo: View {
@State private var dialog = false
let padding = 20
let width = 300
let height = 200
var view: Body {
VStack {
Button("Show Dialog") {
dialog = true
}
.style("pill")
.style("suggested-action")
.frame(maxWidth: 100)
.padding()
}
.dialog(visible: $dialog, title: "Counter", width: width, height: height) {
CounterDemo()
.padding(padding)
.topToolbar {
HeaderBar.empty()
}
}
}
}
// swiftlint:enable missing_docs