Decide what the header gives up when it cannot hold everything

Three faults, all invisible in the source and all found by looking at
the window.

`alignment: start` on the selection bar. Slint only hands space to
`horizontal-stretch` children under the default `stretch` alignment;
under `start` every child takes its preferred width and the stretch is
ignored without complaint. That was harmless while the bar held four
controls. Now that it holds every selection verb it is the difference
between a count that gives way and a row that can only scroll, so the
alignment goes and the stretch does its job.

The title collapsed to "…". An eliding Text has a minimum of nothing,
so once the buttons had taken their own minimums the title was the
cheapest thing in the row to give away — the window stopped saying
which library was open while the byte counts beside it stayed. It gets
a 90px floor.

And the status line does not get one. After the sidebar takes its 232,
a 1100pt window leaves this header about 868, and the buttons want
most of that before a character is drawn — so something must degrade,
and the order is the whole question. A floor here bought a readable
status by pushing Settings off the right edge, reachable only by
knowing to flick-scroll, which is precisely the fault the row's own
Flickable comment warns about. A control you cannot see is worse than
a sentence you cannot finish. The status line is also the most
redundant thing in the header — the sidebar states the library's count
and the filter chips state it again — so it is what gives, and it
grows back the moment there is room.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-30 14:05:24 +02:00
co-authored by Claude Opus 5
parent 700e592b48
commit 677146883f
3 changed files with 54 additions and 20 deletions
+39 -5
View File
@@ -1721,6 +1721,16 @@ export component LibraryGrid inherits Rectangle {
text: root.scope-label != "" ? root.scope-label
: (root.root-label != "" ? root.root-label : "Library");
overflow: elide;
// A floor, for the same reason the status line beside it
// has one — and it is named here because the two of them
// compete. An eliding `Text` has a minimum of nothing, so
// once the buttons had claimed their own minimums the
// title was the cheapest thing in the row to give away and
// it went to a bare "…": the window's own name, gone,
// while the byte counts beside it stayed. Whatever else
// this row drops, it may not stop saying what is being
// looked at.
min-width: 90px;
}
// Everything the grid has to say about itself, in one line:
@@ -1739,6 +1749,22 @@ export component LibraryGrid inherits Rectangle {
text: root.status-line;
overflow: elide;
horizontal-stretch: 1;
// Deliberately without a `min-width`, unlike the title.
//
// This row cannot always hold everything: after the
// sidebar takes its 232, a 1100pt window leaves the header
// about 868, and the buttons alone want most of that
// before a single character is drawn. Something has to
// give, and the order matters — a floor here bought a
// readable status by pushing `Settings` off the right
// edge, reachable only by knowing to flick-scroll, which
// is the exact fault this row's Flickable comment warns
// about.
//
// So this is what gives. It is the most redundant thing in
// the header — the sidebar states the library's count and
// the filter chips state it again — and it grows back the
// moment there is room.
}
// Expanded: the actions sit in the header as one row. There
@@ -1758,10 +1784,10 @@ export component LibraryGrid inherits Rectangle {
open-gestures => { root.helping = true; }
}
// Compact: one button in place of several. Labelled rather than a
// bare glyph, because "⋯" alone in a header of words reads as
// a truncation of the label beside it — which is exactly what
// this change exists to stop happening.
// Compact: one button in place of the row. Labelled rather
// than a bare glyph, because "⋯" alone in a header of words
// reads as a truncation of the label beside it — which is
// exactly what this change exists to stop happening.
if !root.expanded: Button {
text: root.actions-open ? "Close" : "More";
active: root.actions-open;
@@ -3651,7 +3677,15 @@ export component LibraryGrid inherits Rectangle {
padding-left: Theme.gap;
padding-right: Theme.gap;
spacing: Theme.gap-sm;
alignment: start;
// No `alignment: start`, which this row used to carry.
//
// Slint only distributes space to `horizontal-stretch` children
// under the default `stretch` alignment; under `start` every child
// gets its preferred width and stretch is silently ignored. With
// four controls that was invisible. With every selection verb on
// the bar it is the difference between a count that gives way and
// a row that can only scroll, so the count keeps its stretch and
// this keeps the default.
// While a range is armed the strip stops reporting and starts
// instructing. The count is still true, but it is not what the