From ba6d296443780db2d6f2d213937a86dbbbd5b4c0 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Mon, 14 Sep 2026 01:16:52 -0600 Subject: [PATCH] feat(qt): the header search box grows with the window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From 960px up the box takes a quarter of the window width, between the 256px it was designed around and a 480px cap — on a 1720px window that is 353px beside the header nav, where it used to be 196px. Small windows keep the fixed width, the nav still takes its 60px when it lives in the header, and the fit rule reads the box's real edge, so the nav goes compact by itself when the wider box leaves it no room. cc --- crates/qbz-qt/qml/shell/HeaderBar.qml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/crates/qbz-qt/qml/shell/HeaderBar.qml b/crates/qbz-qt/qml/shell/HeaderBar.qml index fd1bf4c71..7f9c43ec5 100644 --- a/crates/qbz-qt/qml/shell/HeaderBar.qml +++ b/crates/qbz-qt/qml/shell/HeaderBar.qml @@ -968,10 +968,16 @@ Rectangle { id: searchBox x: (root.width - width) / 2 y: (root.height - height) / 2 - // 80% of the prior search width; gives up 60px to the section nav - // whenever that nav lives in the header (HeaderBar.slint:569). The - // width animates and `x` re-centers with it. - width: (root.width < 960 ? 179 : 256) - (QbzShell.navInSidebar ? 0 : 60) + // Grows with the window from 960px up (a quarter of it), between the + // 256px the layout was designed around and a 480px cap: wide enough + // to read a query on a 1720px window, never half the screen. Small + // windows keep the fixed 179px. The section nav still takes its 60px + // whenever it lives in the header (HeaderBar.slint:569); the fit rule + // reads this box's real edge, so the nav goes compact by itself when + // the wider box leaves it no room. The width animates and `x` + // re-centers with it. + width: (root.width < 960 ? 179 : Math.round(Math.max(256, Math.min(root.width * 0.24, 480)))) + - (QbzShell.navInSidebar ? 0 : 60) height: 32 Behavior on width { NumberAnimation { duration: 220; easing.type: Easing.InOutQuad }