Make buttons scale with window

This commit is contained in:
TheAlgorithm476 2025-04-16 11:11:58 +02:00
parent 46232968f6
commit 5e6a56b594
1 changed files with 25 additions and 1 deletions

View File

@ -16,53 +16,77 @@ struct AdwaitaTemplate: App {
HStack(spacing: 8) {
Button("AC") {}
.keyboardShortcut("c", app: app)
.hexpand()
Button("") {}
.hexpand()
Button("%") {}
.keyboardShortcut("percent", app: app)
.hexpand()
Button("/") {}
.keyboardShortcut("slash", app: app)
.hexpand()
}
.vexpand()
HStack(spacing: 8) {
Button("7") {}
.keyboardShortcut("7", app: app)
.hexpand()
Button("8") {}
.keyboardShortcut("8", app: app)
.hexpand()
Button("9") {}
.keyboardShortcut("9", app: app)
.hexpand()
Button("*") {}
.keyboardShortcut("asterisk", app: app)
.hexpand()
}
.vexpand()
HStack(spacing: 8) {
Button("4") {}
.keyboardShortcut("4", app: app)
.hexpand()
Button("5") {}
.keyboardShortcut("5", app: app)
.hexpand()
Button("6") {}
.keyboardShortcut("6", app: app)
.hexpand()
Button("-") {}
.keyboardShortcut("minus", app: app)
.hexpand()
}
.vexpand()
HStack(spacing: 8) {
Button("1") {}
.keyboardShortcut("1", app: app)
.hexpand()
Button("2") {}
.keyboardShortcut("2", app: app)
.hexpand()
Button("3") {}
.keyboardShortcut("3", app: app)
.hexpand()
Button("+") {}
.keyboardShortcut("plus", app: app)
.hexpand()
}
.vexpand()
HStack(spacing: 8) {
Button("0") {}
.keyboardShortcut("0", app: app)
.hexpand()
Button("") {}
.hexpand()
Button(",") {}
.keyboardShortcut("comma", app: app)
.hexpand()
Button("=") {}
.keyboardShortcut("equal", app: app)
.hexpand()
}
.vexpand()
}
.frame(maxHeight: .none)
}
.padding()
.topToolbar {