From 47fdfe66228ab00c4a73b48ad1e511baa1cd9e5f Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Tue, 9 Jun 2026 14:41:03 -0600 Subject: [PATCH] fix(myqbz): centre the detail ToolBtn glyph (Filter / Select) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ToolBtn row used an absolute `x: 8/10px` offset together with `width: preferred + padding`, which pushed the icon (and label) off-centre — the Filter and Select buttons read as misaligned. Replace the x offset with symmetric padding-left/right inside the HorizontalLayout and size the button to the layout's natural width, so the glyph is centred deterministically. cc --- crates/qbz-slint/ui/myqbz/MixtapeDetailView.slint | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/qbz-slint/ui/myqbz/MixtapeDetailView.slint b/crates/qbz-slint/ui/myqbz/MixtapeDetailView.slint index a7e60fa6b..d71165a09 100644 --- a/crates/qbz-slint/ui/myqbz/MixtapeDetailView.slint +++ b/crates/qbz-slint/ui/myqbz/MixtapeDetailView.slint @@ -95,14 +95,18 @@ component ToolBtn inherits Rectangle { callback clicked(); height: 30px; border-radius: 6px; - width: row.preferred-width + (root.label == "" ? 16px : 20px); + // Width = the layout's natural size (its own symmetric padding included), so + // the content is centred by the padding rather than an absolute x offset that + // fought the width and pushed the glyph off-centre. + width: row.preferred-width; background: (root.active && root.fill-active) ? Theme.accent : (cb-ta.has-hover ? Theme.surface-hover : Theme.surface-elevated); border-width: 1px; border-color: (root.active && !root.fill-active) ? Theme.accent : Theme.border-subtle; row := HorizontalLayout { - x: root.label == "" ? 8px : 10px; + padding-left: root.label == "" ? 8px : 10px; + padding-right: root.label == "" ? 8px : 10px; height: 100%; spacing: 6px; alignment: center;