Commit Graph

38345 Commits

Author SHA1 Message Date
Carlos Garnacho
d768c2cb84 Remove GtkPressAndHold
This is replaced by GtkGestureLongPress, and all its callers have
been updated to use the replacement.
2014-05-23 19:54:26 +02:00
Carlos Garnacho
4401be22ad enums: Document GtkPropagationPhase 2014-05-23 19:54:26 +02:00
Carlos Garnacho
6296aa84b2 spinbutton: increase/decrease value on upwards/downwards touch swipes
This is somewhat analogous to scroll events on pointer devices, the
greater the velocity, the faster the spinbutton spins.
2014-05-23 19:54:26 +02:00
Carlos Garnacho
c7da5b54f5 Add GtkGesturePan
This gesture reports events on horizontal/vertical panning gestures.
2014-05-23 19:54:26 +02:00
Carlos Garnacho
75b6f4aa52 range: Replace GtkPressAndHold with GtkGestureLongPress 2014-05-23 19:54:26 +02:00
Carlos Garnacho
2166be96d2 swipe: Add function to retrieve the current velocity
This can be used to fetch the current velocity on update(), as opposed
to swipe() which happens after the sequence is finished.
2014-05-23 19:54:26 +02:00
Carlos Garnacho
bd722499dc colorswatch: Replace GtkPressAndHold
GtkGestureLongPress and GtkGestureMultiPress are both used
to replace it.
2014-05-23 19:54:26 +02:00
Carlos Garnacho
d5cb4841c8 colorscale: Replace GtkPressAndHold with GtkLongPressGesture 2014-05-23 19:54:26 +02:00
Carlos Garnacho
8c139c1fca colorplane: Replace GtkPressAndHold with GtkLongPressGesture 2014-05-23 19:54:26 +02:00
Carlos Garnacho
e3d25b3c3c entry: Don't show text handles too eagerly on button press
Instead do so on button release, or after text selection dragging
starts.
2014-05-23 19:54:26 +02:00
Carlos Garnacho
c3075f1d56 longpress: Ensure check() happens after cancel()
And delegate on GtkGesture::check(), it does deal better with
extra fleeting touches.
2014-05-23 19:54:26 +02:00
Carlos Garnacho
c506dfe600 longpress: fix reentrancy on ::reset() 2014-05-23 19:54:26 +02:00
Carlos Garnacho
3cc9543e64 gesturemultipress: fix reentrancy on ::reset() 2014-05-23 19:54:26 +02:00
Carlos Garnacho
cdb5ba9426 gesturesingle: check the current sequence before resetting the pressed button 2014-05-23 19:54:26 +02:00
Carlos Garnacho
490c356954 scrolledwindow: update to gesture widget-level API changes 2014-05-23 19:54:26 +02:00
Carlos Garnacho
ff627511b7 window: update to gesture widget-level API changes 2014-05-23 19:54:26 +02:00
Carlos Garnacho
6350f58c1c treeview: update to gesture widget-level API changes 2014-05-23 19:54:25 +02:00
Carlos Garnacho
c4a39f5abf drag: remove unused #define 2014-05-23 19:54:25 +02:00
Carlos Garnacho
3221d53010 eventcontroller: Add documentation blurb 2014-05-23 19:54:25 +02:00
Carlos Garnacho
040c82f0e8 dnd: Update to gesture widget-level API changes 2014-05-23 19:54:25 +02:00
Carlos Garnacho
51b5fa3bf0 demo: Update to gesture widget-level API changes 2014-05-23 19:54:25 +02:00
Carlos Garnacho
7a71c16317 widget: refactor gesture integration
Listen for notify::sequence-state-changed on the controller, so the
only way to manipulate a sequence state are gtk_gesture_set_sequence_state()
and gtk_gesture_set_state().

Also, make use of gesture groups, so the sequence state is set at once
on all gestures pertaining to a single group. Within a widget, if a sequence
is claimed on one group, it is made to be denied on every other group.
2014-05-23 19:54:25 +02:00
Carlos Garnacho
b0a23dbfbd gesture: Add grouping API
This API eliminates the need for overriding
GtkWidget::sequence-state-changed virtually everywhere. Grouped
gestures share common states for a same GdkEventSequence, so the
state of sequences stay in sync across those.
2014-05-23 19:54:25 +02:00
Carlos Garnacho
6433a5452e gesture: Add gtk_gesture_set_state() helper.
This function sets the state on all sequences where it actually
can, just a helper function to avoid iterating over sequences
yourself.
2014-05-23 19:54:25 +02:00
Carlos Garnacho
72f8c673da gesture: emit the current state on ::sequence-state-changed 2014-05-23 19:54:25 +02:00
Carlos Garnacho
ae241714c4 gesture: group continue conditions together 2014-05-23 19:54:25 +02:00
Carlos Garnacho
8ebcca2ef6 gesture: return TRUE if the sequence state was already set 2014-05-23 19:54:25 +02:00
Carlos Garnacho
f3257e1a54 gesture: fix compiler warning 2014-05-23 19:54:25 +02:00
Carlos Garnacho
4570837e48 gesture: ignore events if now widget window was found 2014-05-23 19:54:25 +02:00
Carlos Garnacho
759705d3e6 eventcontroller: Add propagation-phase property
This is so we don't have to specify the capture phase for
every controller. The default "bubble" value will be sane
on most situations.
2014-05-23 19:54:25 +02:00
Carlos Garnacho
2ed086748f treeview: remove superfluous GTK+ grabs 2014-05-23 19:54:25 +02:00
Carlos Garnacho
2ef4f1bc61 textview: remove superfluous GTK+ grabs 2014-05-23 19:54:25 +02:00
Carlos Garnacho
bae68b5511 iconview: remove superfluous GTK+ grabs 2014-05-23 19:54:24 +02:00
Carlos Garnacho
46b4e5d388 combobox: remove superfluous GTK+ grabs 2014-05-23 19:54:24 +02:00
Carlos Garnacho
db14e22f06 cellrendereraccel: remove superfluous GTK+ grabs 2014-05-23 19:54:24 +02:00
Carlos Garnacho
f766109b5b Revert "gtk: Remove propagation limit of captured events on the grab widget"
This reverts commit 6511f411955adba4f960b8b07d39b93785afe33e.
2014-05-23 19:54:24 +02:00
Carlos Garnacho
cdcc536ddc longpress: Use xsettings to determine long press duration
GtkSettings::gtk-long-press-time is used to this effect.
2014-05-23 19:54:24 +02:00
Carlos Garnacho
1403ebb097 settings: Add gtk-long-press-time setting
This setting determines the duration of a button/touch press to
be considered a long press.
2014-05-23 19:54:24 +02:00
Carlos Garnacho
61e88c251e window: Use gestures for window moving/resizing
A multipress gesture is used to control all this, replacing
single/double click custom code, and triggering window dragging
when the multipress is stopped, yet active (ie. the sequence remains
pressed).
2014-05-23 19:54:24 +02:00
Carlos Garnacho
185da29b68 treeview: Use multipress gesture for row activation
Replace custom double click detection with multipress gesture
2014-05-23 19:54:24 +02:00
Carlos Garnacho
b0eef458d1 dnd: Use GtkGestureDrag to initiate DnD
This gesture is used by gtk_drag_source_set() to determine
whether dragging moved past the threshold. The gesture events
are handled via the usual ::event callbacks, so we don't mess
up with callers expecting that to happen in a signal handler.

If the sequence gets claimed somewhere else in the event widget
stack, the DnD gesture will be cancelled.
2014-05-23 19:54:24 +02:00
Carlos Garnacho
6c78716531 scrolledwindow: Ensure the dragging sequence gets denied if more touches come in
This allows children to receive an emulated press, and handle it together with
the new touch that made the scrolledwindow sequence denied.
2014-05-23 19:54:24 +02:00
Carlos Garnacho
564789777a scrolledwindow: Fix overshoot coordinates
With gtk_gesture_get_point() returning events in
gtk_event_controller_get_widget() coordinates, we no longer need
to compensate for the overshoot here.
2014-05-23 19:54:24 +02:00
Carlos Garnacho
38e40a55f4 widget: Add gtk_widget_set_gesture_state()
This helper function ensures the state is propagated for
all the active sequences in the given gesture.
2014-05-23 19:54:24 +02:00
Carlos Garnacho
8e1d5f98de widget: Improve button press emulation on sequence denied
Ensure that state being set on pointer emulating touches actually
gets propagated properly on widgets with gestures that only handle
pointer events.
2014-05-23 19:54:24 +02:00
Carlos Garnacho
c49ac32393 swipe: Dont emit swipe() if the gesture was denied rather than finished 2014-05-23 19:54:24 +02:00
Carlos Garnacho
55683c075c drag: Make API offsets based
It is generally more useful to get offsets right away,
than having to calculate those from the start point.
2014-05-23 19:54:24 +02:00
Carlos Garnacho
6cd0e733f5 scrolledwindow: Use GtkGestureSingle API 2014-05-23 19:54:24 +02:00
Carlos Garnacho
cece9cac07 scrolledwindow: Update gesture API change. 2014-05-23 19:54:23 +02:00
Carlos Garnacho
84885c6e26 demo: Update to gesture API change 2014-05-23 19:54:23 +02:00