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:
@@ -3480,6 +3480,18 @@ pub fn wire<F>(
|
||||
// controllers would hold each other alive for the life of the process.
|
||||
*ctl.coll_ctl.borrow_mut() = Some(Rc::downgrade(&coll_ctl));
|
||||
|
||||
// TRACES: FR-UI-3 | FR-UI-4
|
||||
// Whether the rating strip waits to be hovered or stands open.
|
||||
//
|
||||
// On Android touch is not evidence to be gathered, it is the platform.
|
||||
// The grid latches it from the first finger it sees as well, which is what
|
||||
// covers a touchscreen on the desktop — but that latch needs a press to
|
||||
// reach a cell, and a quick flick never delivers one because the Flickable
|
||||
// claims the gesture before the delay it would forward after. Seeding it
|
||||
// here means the stars are on screen before the first touch rather than
|
||||
// after it, which is the whole point of showing them.
|
||||
window.set_library_touched(cfg!(target_os = "android"));
|
||||
|
||||
// Shared rather than moved: a click and `Return` both open an image, and
|
||||
// they are two callbacks.
|
||||
let on_open_image = Rc::new(on_open_image);
|
||||
|
||||
Reference in New Issue
Block a user