From 5e6a56b5948f2cc9fca77f4663e9a035b70b1749 Mon Sep 17 00:00:00 2001 From: TheAlgorithm476 Date: Wed, 16 Apr 2025 11:11:58 +0200 Subject: [PATCH] Make buttons scale with window --- Sources/AdwaitaTemplate.swift | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Sources/AdwaitaTemplate.swift b/Sources/AdwaitaTemplate.swift index 94a8b68..7b3b866 100644 --- a/Sources/AdwaitaTemplate.swift +++ b/Sources/AdwaitaTemplate.swift @@ -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 {