Stop drawing a hover ring on a device that cannot hover
A cell drew a 1px ring while the pointer was over it, in the same colour as the 2px ring that means "selected". On a tablet there is no pointer, and `has-hover` is not the harmless no-op that implies: Slint raises it on a touch press and lowers it on the `Exit` that normally follows the release — but the release that ends a pinch carries no `Exit` at all, and neither does a finger lifting while a second one is still down. So resizing the thumbnails, which is a pinch, left a ring around whichever cell each finger had come down on. The grid then showed boxes around photographs that were not selected, a pixel thinner than the ones that were, with nothing to tell them apart. Hover chrome has no meaning once there has been a finger, so it is not drawn: the same `touched` latch the rating strip already keys off. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2976,7 +2976,19 @@ export component LibraryGrid inherits Rectangle {
|
||||
// photograph, which is exactly the wrong feedback for a
|
||||
// gesture whose whole job is to say "this one". One
|
||||
// treatment, drawn inside, in one place.
|
||||
border-width: cell-touch.has-hover ? 1px : 0px;
|
||||
//
|
||||
// **Not drawn at all once there has been a finger.** A
|
||||
// hand has no hover to give, so on a tablet this ring can
|
||||
// only ever be wrong — and it is wrong in the worst way,
|
||||
// because it is the selection ring's own colour a pixel
|
||||
// thinner. `has-hover` is not reliably cleared on touch:
|
||||
// a release normally brings an `Exit` with it, but the one
|
||||
// that ends a pinch does not, so every pinch to resize the
|
||||
// thumbnails left a ring around whichever cell a finger
|
||||
// happened to have started on. The grid then showed boxes
|
||||
// around photographs that were not selected, with no way
|
||||
// to tell them from ones that were. See `touched`.
|
||||
border-width: cell-touch.has-hover && !root.touched ? 1px : 0px;
|
||||
border-color: Theme.selected-ring;
|
||||
clip: true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user