Put a scrollbar on the collections sidebar

A tree longer than the panel looked, to a mouse, like the whole tree.
Same shape as the develop column: the Flickable fills a Rectangle that
takes its stretch, and a ScrollBar is drawn over its right edge. It is
drawn only when the tree overflows.
This commit is contained in:
2026-09-26 07:25:07 -04:00
parent 825015a58e
commit 005dc3a835
3 changed files with 86 additions and 72 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -407,7 +407,7 @@ Double-click is what a file manager and a Lightroom panel use for the same thing
Under the trash because the trash is where the spare copies go, and only while the catalog holds any: a row that is always there and usually empty is noise.
<sub>`ui/dr-ui/ui/collections.slint:870`</sub>
<sub>`ui/dr-ui/ui/collections.slint:884`</sub>
## Duplicate originals
+16 -2
View File
@@ -34,7 +34,7 @@
import { Theme } from "theme.slint";
import { Duplicates } from "duplicates.slint";
import { Keys } from "keys.slint";
import { Button, Icon } from "widgets.slint";
import { Button, Icon, ScrollBar } from "widgets.slint";
// One row of the collection tree.
export struct CollectionRow {
@@ -673,8 +673,11 @@ export component CollectionsPanel inherits Rectangle {
}
// --- the tree -----------------------------------------------------
Flickable {
Rectangle {
vertical-stretch: 1;
tree-flick := Flickable {
width: parent.width;
height: parent.height;
viewport-height: root.rows.length * (Theme.row-height + 2px);
// Wrapped rather than made draggable from the inside: the grid's
@@ -746,6 +749,17 @@ export component CollectionsPanel inherits Rectangle {
}
}
// A bar for a pointer: a tree of collections longer than the panel
// otherwise looks, to a mouse, like the whole tree.
ScrollBar {
x: parent.width - self.width;
y: 0px;
viewport-y <=> tree-flick.viewport-y;
viewport-height: tree-flick.viewport-height;
visible-height: tree-flick.height;
}
}
// TRACES: FR-NC-6a
// Keep the scoped collection on this device.
//