2023-11-26 21:16:54 +00:00
|
|
|
// The Swift Programming Language
|
|
|
|
// https://docs.swift.org/swift-book
|
|
|
|
|
|
|
|
import Adwaita
|
|
|
|
|
|
|
|
@main
|
|
|
|
struct AdwaitaTemplate: App {
|
2024-10-08 10:35:29 +00:00
|
|
|
let app = AdwaitaApp(id: "io.github.AparokshaUI.AdwaitaTemplate")
|
2023-11-26 21:16:54 +00:00
|
|
|
|
|
|
|
var scene: Scene {
|
|
|
|
Window(id: "main") { window in
|
2025-04-16 09:03:15 +00:00
|
|
|
VStack(spacing: 8) {
|
2025-04-15 08:33:32 +00:00
|
|
|
Text("Calculations here...")
|
|
|
|
.selectable(false)
|
2025-04-16 09:03:15 +00:00
|
|
|
VStack(spacing: 8) {
|
|
|
|
HStack(spacing: 8) {
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("AC") {}
|
|
|
|
.keyboardShortcut("c", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("") {}
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("%") {}
|
2025-04-16 09:03:15 +00:00
|
|
|
.keyboardShortcut("percent", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("/") {}
|
2025-04-16 09:03:15 +00:00
|
|
|
.keyboardShortcut("slash", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
}
|
2025-04-16 09:11:58 +00:00
|
|
|
.vexpand()
|
2025-04-16 09:03:15 +00:00
|
|
|
HStack(spacing: 8) {
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("7") {}
|
|
|
|
.keyboardShortcut("7", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("8") {}
|
|
|
|
.keyboardShortcut("8", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("9") {}
|
|
|
|
.keyboardShortcut("9", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("*") {}
|
2025-04-16 09:03:15 +00:00
|
|
|
.keyboardShortcut("asterisk", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
}
|
2025-04-16 09:11:58 +00:00
|
|
|
.vexpand()
|
2025-04-16 09:03:15 +00:00
|
|
|
HStack(spacing: 8) {
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("4") {}
|
|
|
|
.keyboardShortcut("4", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("5") {}
|
|
|
|
.keyboardShortcut("5", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("6") {}
|
|
|
|
.keyboardShortcut("6", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("-") {}
|
2025-04-16 09:03:15 +00:00
|
|
|
.keyboardShortcut("minus", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
}
|
2025-04-16 09:11:58 +00:00
|
|
|
.vexpand()
|
2025-04-16 09:03:15 +00:00
|
|
|
HStack(spacing: 8) {
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("1") {}
|
|
|
|
.keyboardShortcut("1", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("2") {}
|
|
|
|
.keyboardShortcut("2", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("3") {}
|
|
|
|
.keyboardShortcut("3", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("+") {}
|
2025-04-16 09:03:15 +00:00
|
|
|
.keyboardShortcut("plus", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
}
|
2025-04-16 09:11:58 +00:00
|
|
|
.vexpand()
|
2025-04-16 09:03:15 +00:00
|
|
|
HStack(spacing: 8) {
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("0") {}
|
|
|
|
.keyboardShortcut("0", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("") {}
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
Button(",") {}
|
2025-04-16 09:03:15 +00:00
|
|
|
.keyboardShortcut("comma", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
Button("=") {}
|
2025-04-16 09:03:15 +00:00
|
|
|
.keyboardShortcut("equal", app: app)
|
2025-04-16 09:11:58 +00:00
|
|
|
.hexpand()
|
2025-04-15 08:33:32 +00:00
|
|
|
}
|
2025-04-16 09:11:58 +00:00
|
|
|
.vexpand()
|
2023-11-26 21:16:54 +00:00
|
|
|
}
|
2025-04-15 08:33:32 +00:00
|
|
|
}
|
|
|
|
.padding()
|
|
|
|
.topToolbar {
|
|
|
|
ToolbarView(app: app, window: window)
|
|
|
|
}
|
2023-11-26 21:16:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|