feat(qt): the header search box grows with the window

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
This commit is contained in:
vicrodh committed 2026-09-14 01:16:52 -06:00
1 parent 64d75e497a
commit ba6d296443
1 file changed
+10 -4
+10 -4
View File
@@ -968,10 +968,16 @@ Rectangle {
id: searchBox id: searchBox
x: (root.width - width) / 2 x: (root.width - width) / 2
y: (root.height - height) / 2 y: (root.height - height) / 2
// 80% of the prior search width; gives up 60px to the section nav // Grows with the window from 960px up (a quarter of it), between the
// whenever that nav lives in the header (HeaderBar.slint:569). The // 256px the layout was designed around and a 480px cap: wide enough
// width animates and `x` re-centers with it. // to read a query on a 1720px window, never half the screen. Small
width: (root.width < 960 ? 179 : 256) - (QbzShell.navInSidebar ? 0 : 60) // 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 height: 32
Behavior on width { Behavior on width {
NumberAnimation { duration: 220; easing.type: Easing.InOutQuad } NumberAnimation { duration: 220; easing.type: Easing.InOutQuad }