diff --git a/ui/dr-ui/ui/library.slint b/ui/dr-ui/ui/library.slint index 2dabbe1..44651e6 100644 --- a/ui/dr-ui/ui/library.slint +++ b/ui/dr-ui/ui/library.slint @@ -1349,11 +1349,25 @@ export component LibraryGrid inherits Rectangle { // thought it could draw. Seven action buttons and four readouts do // not fit across a tablet even in landscape, which is why the last // one was clipped by the screen edge. + // + // Sized to `min-width`, not `preferred-width`: the latter is the + // row's *untruncated* footprint — every readout at its natural + // text width — so the Flickable was always at least that wide and + // the row never actually shrank, it just scrolled, with the + // sidebar toggle and the "More" disclosure off past the right + // edge on anything narrower than a tablet. `min-width` is what + // the row needs once its `elide` + `horizontal-stretch: 1` + // readouts (image count, selection count, scan status, the + // window label below) are collapsed to an ellipsis, so a window + // with room for that shrunk row now gets the row shrunk to fit + // instead of scrolled — and the toggle and disclosure, which + // don't shrink, stay on screen. Only a window too narrow even for + // the shrunk row still scrolls. Flickable { width: 100%; height: 100%; viewport-height: self.height; - viewport-width: max(self.width, header-row.preferred-width); + viewport-width: max(self.width, header-row.min-width); header-row := HorizontalLayout { width: parent.viewport-width; @@ -1381,7 +1395,18 @@ export component LibraryGrid inherits Rectangle { overflow: elide; } - Caption { text: root.total > 0 ? root.total + " images" : ""; } + // `elide` + `horizontal-stretch: 1`, like `window-label` below: + // stretch is what actually lets a `Text` shrink under pressure + // in Slint, not `elide` alone (see the comment on the header + // row's Flickable) — without it these three readouts kept + // their full natural width and were what pushed the sidebar + // toggle and the "More" button past the right edge on a + // narrow window, reachable only by knowing to flick-scroll. + Caption { + text: root.total > 0 ? root.total + " images" : ""; + overflow: elide; + horizontal-stretch: 1; + } // The selection count, and how to act on it. Both appear only // when something is selected — an empty selection has nothing @@ -1395,6 +1420,8 @@ export component LibraryGrid inherits Rectangle { modified: true; compact: true; font-weight: 600; + overflow: elide; + horizontal-stretch: 1; } Label { @@ -1410,6 +1437,8 @@ export component LibraryGrid inherits Rectangle { : (root.sweeping ? "indexing " + root.sweep-done + " / " + root.sweep-total : root.scan-status); + overflow: elide; + horizontal-stretch: 1; } // Where in the library the visible window sits. A scrubbable