From f11cb56c12be89c2df3e258be23770b371dd236a Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Sat, 3 Oct 2026 11:14:30 +0200 Subject: [PATCH] Replace grid hack with FlexBox for GoodButtons --- gui/ui/app.slint | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/gui/ui/app.slint b/gui/ui/app.slint index ab4a452..d65939b 100644 --- a/gui/ui/app.slint +++ b/gui/ui/app.slint @@ -186,19 +186,21 @@ component GoodButtons inherits ScrollView { property count-x: floor(root.width / (button-min-width + button-spacing)); property count-y: ceil(State.favorites.length / count-x); - property button-width: ((self.width + button-spacing) / count-x) - button-spacing; + property button-width: ((root.width + button-spacing) / count-x) - button-spacing; content-height: (count-y * (button-height + button-spacing)); mouse-drag-pan-enabled: true; + vertical-scrollbar-policy: always-off; - for item[idx] in State.favorites: Button { - x: floor(mod(idx, count-x)) * (root.button-width + root.button-spacing); - y: floor(idx / count-x) * (root.button-height + root.button-spacing); - width: root.button-width; - height: root.button-height; - text: item.name; - clicked => { - State.add-to-list(item.name); + FlexboxLayout { + spacing: button-spacing; + for item in State.favorites: Button { + width: root.button-width; + height: root.button-height; + text: item.name; + clicked => { + State.add-to-list(item.name); + } } } }