Commit graph

6 commits

Author SHA1 Message Date
Olivier Goffart
9734bfdd8e
SwipeGestureRecognizer: fix cancel() function
It was implemented in the compiler, but not in the runtime
2024-10-09 18:06:32 +02:00
Olivier Goffart
fd299302ef
TouchArea: send cancel event when disabled while pressed (#6424)
ChangeLog: TouchArea: Send cancel event and update `pressed` and `has-hover`
property when `enabled` is set to false while pressed.

Fixes: #6422
2024-10-01 17:07:47 +02:00
Olivier Goffart
c5954f61c0
SwipeGestureHandler: improve behavior
- Remove the duration threshold
 - Always register the swipe even if the pointer went in another
   direction before
 - set the current position on the release event (in case there was no
   mouve to that position before)

ChangeLog: adjusted threshold in the SwipeGestureHandler

Closes #6344
Probably also helps for #6350
2024-10-01 13:39:01 +02:00
Simon Hausmann
cd2b738c7a Rename SwipeGestureRecognizer to SwipeGestureHandler
The origin of this proposal is the name of the `swipe-left`, etc.
directional, boolean properties. They're missing another verb in their
name. In principle the right choice would be "recognize". That is what
the type name suggests, that's the term the documentation uses, so the
code should read `recognize-swipe-left: true;`. However that is a long
word. "Handle" is a verb that's simpler. It's also more generic (that's
a downside), but it's otherwise short enough to make things look
"right":

```
SwipeGestureHandler {
    handle-swipe-left: true;
    swiped => { something.naviate-left(); }
}
```

Therefore this patch proposes to rename the type to SwipeGestureHandler
and prefixes the boolean directional properties with "handle".
2024-09-18 16:37:27 +02:00
Olivier Goffart
5663ddd9cc
SwipeGestureRecognizer (#6005) 2024-09-09 14:40:55 +02:00
Olivier Goffart
80c497b319 refactor: move FocusScope and TouchArea to a new input_items.rs module
items.rs is getting big and i'm about to add another item there
2024-08-29 09:38:26 +02:00