87 lines
3.3 KiB
Swift
87 lines
3.3 KiB
Swift
// The Swift Programming Language
|
|
// https://docs.swift.org/swift-book
|
|
|
|
import Adwaita
|
|
|
|
@main
|
|
struct AdwaitaTemplate: App {
|
|
let app = AdwaitaApp(id: "io.github.AparokshaUI.AdwaitaTemplate")
|
|
|
|
var scene: Scene {
|
|
Window(id: "main") { window in
|
|
VStack {
|
|
Text("Calculations here...")
|
|
.selectable(false)
|
|
VStack {
|
|
HStack {
|
|
Button("AC") {}
|
|
.keyboardShortcut("c", app: app)
|
|
Button("") {}
|
|
Button("%") {}
|
|
.keyboardShortcut("%", app: app)
|
|
Button("/") {}
|
|
.keyboardShortcut("/", app: app)
|
|
}
|
|
.modifyContent(VStack.self) { $0.spacing(8) }
|
|
.frame(maxWidth: .none)
|
|
HStack {
|
|
Button("7") {}
|
|
.keyboardShortcut("7", app: app)
|
|
Button("8") {}
|
|
.keyboardShortcut("8", app: app)
|
|
Button("9") {}
|
|
.keyboardShortcut("9", app: app)
|
|
Button("*") {}
|
|
.keyboardShortcut("*", app: app)
|
|
}
|
|
.modifyContent(VStack.self) { $0.spacing(8) }
|
|
.frame(maxWidth: .none)
|
|
HStack {
|
|
Button("4") {}
|
|
.keyboardShortcut("4", app: app)
|
|
Button("5") {}
|
|
.keyboardShortcut("5", app: app)
|
|
Button("6") {}
|
|
.keyboardShortcut("6", app: app)
|
|
Button("-") {}
|
|
.keyboardShortcut("-", app: app)
|
|
}
|
|
.modifyContent(VStack.self) { $0.spacing(8) }
|
|
.frame(maxWidth: .none)
|
|
HStack {
|
|
Button("1") {}
|
|
.keyboardShortcut("1", app: app)
|
|
Button("2") {}
|
|
.keyboardShortcut("2", app: app)
|
|
Button("3") {}
|
|
.keyboardShortcut("3", app: app)
|
|
Button("+") {}
|
|
.keyboardShortcut("+", app: app)
|
|
}
|
|
.modifyContent(VStack.self) { $0.spacing(8) }
|
|
.frame(maxWidth: .none)
|
|
HStack {
|
|
Button("0") {}
|
|
.keyboardShortcut("0", app: app)
|
|
Button("") {}
|
|
Button(",") {}
|
|
.keyboardShortcut(",", app: app)
|
|
Button("=") {}
|
|
.keyboardShortcut("=", app: app)
|
|
}
|
|
.modifyContent(VStack.self) { $0.spacing(8) }
|
|
.frame(maxWidth: .none)
|
|
}
|
|
.spacing(8)
|
|
.frame(maxHeight: .none)
|
|
}
|
|
.spacing(8)
|
|
.padding()
|
|
.topToolbar {
|
|
ToolbarView(app: app, window: window)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|