From 9257a6e52a8be8935fcb787d93160b86c2880746 Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Sat, 21 Mar 2026 23:11:59 +0100 Subject: [PATCH] Revert "Fix GoodButtons alignment" This reverts commit 11b96cd1729ee7666e1cc506e39c327a2b757225. The commit works in LIVE_PREVIEW mode, but not otherwise. --- gui/ui/app.slint | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/gui/ui/app.slint b/gui/ui/app.slint index b3a4382..0c02324 100644 --- a/gui/ui/app.slint +++ b/gui/ui/app.slint @@ -183,22 +183,20 @@ component GoodButtons inherits ScrollView { in property button-height: 60; in property button-spacing: 10; - property count-x: max(1, floor(root.width / 1pt / (button-width + button-spacing))); + property count-x: floor(root.width / 1pt / (button-width + button-spacing)); property count-y: ceil(favorites.length / count-x); + viewport-height: (count-y * (button-height + button-spacing)) * 1pt; mouse-drag-pan-enabled: true; - GridBox { - for item[idx] in favorites: Button { - col: floor(mod(idx, count-x)); - row: floor(idx / count-x); - min-width: 100pt; - min-height: 60pt; - max-height: 100pt; - text: item; - clicked => { - State.add-to-list(item); - } + for item[idx] in favorites: Button { + x: floor(mod(idx, count-x)) * (root.button-width + root.button-spacing) * 1pt; + y: floor(idx / count-x) * (root.button-height + root.button-spacing) * 1pt; + width: root.button-width * 1pt; + height: root.button-height * 1pt; + text: item; + clicked => { + State.add-to-list(item); } } }