Show which cell a shift-click is measuring from
The gesture had a hidden operand. A range runs from the anchor — the last cell plainly clicked — to the cell shift-clicked, and nothing on screen said which one the anchor was. A user who could not tell where the range was being measured from had no way to predict what it would take and no clue why a wrong one came out wrong; often the anchor is not on screen at all, which is itself the answer to "why did that select so much". The anchor is marked with an inner ring, drawn inside the selection ring rather than in a colour of its own: it has to stay legible against a thumbnail of any brightness, and a hue would read as a second kind of selection. It is an ordinal, so it marks a row only while the photograph it names is in the loaded window — off screen it marks nothing, which is the honest answer, and `anchor` rides in the cell model beside `selected` so both are pushed by the one pass that already keeps the grid in step with the selection. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -430,6 +430,14 @@ export struct LibraryCell {
|
||||
// Part of the current selection. Selection is what a drag carries, so this
|
||||
// has to be per-cell state rather than a single "current" index.
|
||||
selected: bool,
|
||||
// The cell a shift-click would extend *from* — the last one plainly
|
||||
// clicked. Marked because otherwise the gesture has a hidden operand: the
|
||||
// user picks the far end of a run with no way to see which end the range
|
||||
// is being measured from, and a range that comes out wrong gives no clue
|
||||
// why. At most one cell in the library carries this, and often none of
|
||||
// them is on screen — which is itself the answer to "why did that select
|
||||
// so much".
|
||||
anchor: bool,
|
||||
// How many collections this image belongs to. An image can be in many at
|
||||
// once, and without a cue the grid gives no hint that a photograph has
|
||||
// already been filed — the user re-files it, or hunts for where it went.
|
||||
@@ -2687,6 +2695,22 @@ export component LibraryGrid inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
// The end a shift-click measures from. An inner ring rather
|
||||
// than a colour of its own: it has to be legible against a
|
||||
// thumbnail of any brightness and must not read as a second
|
||||
// kind of selection, which a hue would.
|
||||
Rectangle {
|
||||
visible: cell.anchor;
|
||||
x: 4px;
|
||||
y: 4px;
|
||||
width: parent.width - 8px;
|
||||
height: parent.height - 8px;
|
||||
background: transparent;
|
||||
border-width: 1px;
|
||||
border-color: Theme.selected-ring;
|
||||
border-radius: Theme.radius-sm;
|
||||
}
|
||||
|
||||
// Selection only. The drag is the enclosing `DragArea`'s
|
||||
// business, and Slint keeps a click distinct from a drag for
|
||||
// us — which is exactly the arbitration the hand-rolled version
|
||||
|
||||
Reference in New Issue
Block a user