[libadwaita/wip/exalm/swipe-group: 11/14] Add adw_swipe_tracker_reset()
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/swipe-group: 11/14] Add adw_swipe_tracker_reset()
- Date: Fri, 7 May 2021 07:29:03 +0000 (UTC)
commit 270c228ac6c66df0b6ba2d9054f2110ac7edde7c
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Fri Feb 26 14:50:08 2021 +0500
Add adw_swipe_tracker_reset()
Stop using adw_swipe_tracker_emit_end_swipe() so we can remove it.
src/adw-leaflet.c | 2 +-
src/adw-swipe-tracker-private.h | 2 ++
src/adw-swipe-tracker.c | 15 +++++++++++++++
3 files changed, 18 insertions(+), 1 deletion(-)
---
diff --git a/src/adw-leaflet.c b/src/adw-leaflet.c
index de227ac..374d229 100644
--- a/src/adw-leaflet.c
+++ b/src/adw-leaflet.c
@@ -2931,7 +2931,7 @@ adw_leaflet_reorder_child_after (AdwLeaflet *self,
previous_position = g_list_index (self->children, child) - 1;
/* Cancel a gesture if there's one in progress */
- adw_swipe_tracker_emit_end_swipe (self->tracker, 0, 0.0);
+ adw_swipe_tracker_reset (self->tracker);
child_page = find_page_for_widget (self, child);
self->children = g_list_remove (self->children, child_page);
diff --git a/src/adw-swipe-tracker-private.h b/src/adw-swipe-tracker-private.h
index b07a400..658b7ee 100644
--- a/src/adw-swipe-tracker-private.h
+++ b/src/adw-swipe-tracker-private.h
@@ -24,4 +24,6 @@ void adw_swipe_tracker_emit_end_swipe (AdwSwipeTracker *self,
gint64 duration,
double to);
+void adw_swipe_tracker_reset (AdwSwipeTracker *self);
+
G_END_DECLS
diff --git a/src/adw-swipe-tracker.c b/src/adw-swipe-tracker.c
index bb30703..1a0c435 100644
--- a/src/adw-swipe-tracker.c
+++ b/src/adw-swipe-tracker.c
@@ -1380,3 +1380,18 @@ adw_swipe_tracker_emit_end_swipe (AdwSwipeTracker *self,
g_signal_emit (self, signals[SIGNAL_END_SWIPE], 0, duration, to);
}
+
+void
+adw_swipe_tracker_reset (AdwSwipeTracker *self)
+{
+ g_return_if_fail (ADW_IS_SWIPE_TRACKER (self));
+
+ if (self->touch_gesture_capture)
+ gtk_event_controller_reset (GTK_EVENT_CONTROLLER (self->touch_gesture_capture));
+
+ if (self->touch_gesture)
+ gtk_event_controller_reset GTK_EVENT_CONTROLLER ((self->touch_gesture));
+
+ if (self->scroll_controller)
+ gtk_event_controller_reset (self->scroll_controller);
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]