Add some more calculator-like layout
This commit is contained in:
parent
8811c923f4
commit
b8b7e692cc
|
@ -5,18 +5,82 @@ import Adwaita
|
|||
|
||||
@main
|
||||
struct AdwaitaTemplate: App {
|
||||
|
||||
let app = AdwaitaApp(id: "io.github.AparokshaUI.AdwaitaTemplate")
|
||||
|
||||
var scene: Scene {
|
||||
Window(id: "main") { window in
|
||||
Text(Loc.helloWorld)
|
||||
.padding()
|
||||
.topToolbar {
|
||||
ToolbarView(app: app, window: window)
|
||||
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)
|
||||
}
|
||||
}
|
||||
.defaultSize(width: 450, height: 300)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue