summaryrefslogtreecommitdiff
path: root/gtk/gtkrange.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-03-09 06:36:22 +0100
committerCarlos Garnacho <carlosg@gnome.org>2018-04-26 17:59:42 +0200
commitbf82149271b4f6bf6379b22eeea191dffe6823dd (patch)
treec72d4f5b5ed8a26efc7a0ea5f27e439f09ab8917 /gtk/gtkrange.c
parent4ddc94b293504b56c0106b0177c36c8efd2d3a57 (diff)
downloadgtk+-bf82149271b4f6bf6379b22eeea191dffe6823dd.tar.gz
longpressgesture: Port to new API model
Diffstat (limited to 'gtk/gtkrange.c')
-rw-r--r--gtk/gtkrange.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index f1a6acc179..f79e60beb6 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -115,7 +115,6 @@ struct _GtkRangePrivate
/* Whether dragging is ongoing */
guint in_drag : 1;
- GtkGesture *long_press_gesture;
GtkGesture *multipress_gesture;
GtkGesture *drag_gesture;
GtkEventController *scroll_controller;
@@ -535,6 +534,7 @@ static void
gtk_range_init (GtkRange *range)
{
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
+ GtkGesture *gesture;
gtk_widget_set_has_surface (GTK_WIDGET (range), FALSE);
@@ -583,11 +583,12 @@ gtk_range_init (GtkRange *range)
gtk_widget_add_controller (GTK_WIDGET (range), GTK_EVENT_CONTROLLER (priv->multipress_gesture));
gtk_gesture_group (priv->drag_gesture, priv->multipress_gesture);
- priv->long_press_gesture = gtk_gesture_long_press_new (GTK_WIDGET (range));
- g_object_set (priv->long_press_gesture, "delay-factor", 2.0, NULL);
- gtk_gesture_group (priv->drag_gesture, priv->long_press_gesture);
- g_signal_connect (priv->long_press_gesture, "pressed",
+ gesture = gtk_gesture_long_press_new ();
+ g_object_set (gesture, "delay-factor", 2.0, NULL);
+ g_signal_connect (gesture, "pressed",
G_CALLBACK (gtk_range_long_press_gesture_pressed), range);
+ gtk_widget_add_controller (GTK_WIDGET (range), GTK_EVENT_CONTROLLER (gesture));
+ gtk_gesture_group (priv->drag_gesture, gesture);
priv->scroll_controller =
gtk_event_controller_scroll_new (GTK_WIDGET (range),
@@ -1293,7 +1294,6 @@ gtk_range_finalize (GObject *object)
GtkRangePrivate *priv = gtk_range_get_instance_private (range);
g_clear_object (&priv->drag_gesture);
- g_clear_object (&priv->long_press_gesture);
g_clear_object (&priv->scroll_controller);
g_clear_object (&priv->key_controller);