Leave the stars on screen on a touch device
**Hover is not something a finger does, but Slint reports it anyway.** `has-hover` goes true for any pointer event carrying a position, a touch press included, and false again on the `Exit` that follows the release. So the rating strip did appear on a tablet — for exactly the length of a tap. It flashed on under the finger, vanished as it lifted, and the tap carried on through to the cell and opened the photograph. An unjudged frame could not be rated from the grid at all. The previous fix stopped the strip disappearing when a *pointer* moved onto it; this is the same symptom with a different cause, and hover was the wrong signal in the first place. The strip now stands open where the session is a touch one. That is seeded from the platform rather than inferred, because inference needs a press to reach a cell and a quick flick never delivers one — the Flickable claims the gesture before the delay it would forward after — and a control that only appears once the finger is down has appeared too late to aim at. The grid still latches on the first non-zero touch id it sees, which is what covers a touchscreen on the desktop. One-way on purpose: a tablet with a mouse plugged in keeps the strips once touched, which is the harmless direction to be wrong in. The alternative is chrome that comes and goes as the user changes hands.
This commit is contained in:
@@ -507,6 +507,10 @@ export component AppWindow inherits Window {
|
||||
in-out property <int> library-columns: 1;
|
||||
in property <bool> library-syncing: false;
|
||||
in-out property <length> library-cell-size: 180px;
|
||||
/// Whether this session is a touch one, which decides if the rating strip
|
||||
/// waits to be hovered or stands open. Seeded from the platform by Rust
|
||||
/// and latched by the grid on the first finger it sees.
|
||||
in-out property <bool> library-touched: false;
|
||||
callback library-zoom-cells(int);
|
||||
/// A pinch step on the grid: the ratio since the last update.
|
||||
callback library-pinch-cells(float);
|
||||
@@ -1133,6 +1137,7 @@ in property <bool> panel-visible: true;
|
||||
timeline-zoom(d) => { root.library-timeline-zoom(d); }
|
||||
syncing: root.library-syncing;
|
||||
requested-cell-size: root.library-cell-size;
|
||||
touched <=> root.library-touched;
|
||||
zoom-cells(d) => { root.library-zoom-cells(d); }
|
||||
pinch-cells(r) => { root.library-pinch-cells(r); }
|
||||
pinch-started() => { root.library-pinch-started(); }
|
||||
|
||||
Reference in New Issue
Block a user