summaryrefslogtreecommitdiff
path: root/gtk/gtkcolorplane.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-03-10 18:05:57 +0100
committerCarlos Garnacho <carlosg@gnome.org>2018-04-26 17:59:42 +0200
commit1e6eb1f8b94ad10f30678285860dc24877bbbac3 (patch)
treeeef4b5f579a657072967e7f7dd047494af5add1d /gtk/gtkcolorplane.c
parentbf82149271b4f6bf6379b22eeea191dffe6823dd (diff)
downloadgtk+-1e6eb1f8b94ad10f30678285860dc24877bbbac3.tar.gz
draggesture: Port to new API model
Diffstat (limited to 'gtk/gtkcolorplane.c')
-rw-r--r--gtk/gtkcolorplane.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/gtk/gtkcolorplane.c b/gtk/gtkcolorplane.c
index 30d0a80056..0d2ea83d38 100644
--- a/gtk/gtkcolorplane.c
+++ b/gtk/gtkcolorplane.c
@@ -37,7 +37,6 @@ struct _GtkColorPlanePrivate
GdkTexture *texture;
- GtkGesture *drag_gesture;
GtkEventController *key_controller;
};
@@ -408,14 +407,15 @@ gtk_color_plane_init (GtkColorPlane *plane)
atk_object_set_role (atk_obj, ATK_ROLE_COLOR_CHOOSER);
}
- plane->priv->drag_gesture = gtk_gesture_drag_new (GTK_WIDGET (plane));
- g_signal_connect (plane->priv->drag_gesture, "drag-begin",
+ gesture = gtk_gesture_drag_new ();
+ g_signal_connect (gesture, "drag-begin",
G_CALLBACK (plane_drag_gesture_begin), plane);
- g_signal_connect (plane->priv->drag_gesture, "drag-update",
+ g_signal_connect (gesture, "drag-update",
G_CALLBACK (plane_drag_gesture_update), plane);
- g_signal_connect (plane->priv->drag_gesture, "drag-end",
+ g_signal_connect (gesture, "drag-end",
G_CALLBACK (plane_drag_gesture_end), plane);
- gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (plane->priv->drag_gesture), 0);
+ gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
+ gtk_widget_add_controller (GTK_WIDGET (plane), GTK_EVENT_CONTROLLER (gesture));
gesture = gtk_gesture_long_press_new ();
g_signal_connect (gesture, "pressed",
@@ -440,7 +440,6 @@ plane_finalize (GObject *object)
g_clear_object (&plane->priv->s_adj);
g_clear_object (&plane->priv->v_adj);
- g_clear_object (&plane->priv->drag_gesture);
g_clear_object (&plane->priv->key_controller);
G_OBJECT_CLASS (gtk_color_plane_parent_class)->finalize (object);