diff options
author | Benjamin Otte <otte@redhat.com> | 2018-03-09 06:14:59 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2018-04-26 17:59:42 +0200 |
commit | 4ddc94b293504b56c0106b0177c36c8efd2d3a57 (patch) | |
tree | b620c608c025e287685a04afa8429d5541e12274 /gtk/gtkflowbox.c | |
parent | 71991270b047c66e7c14a65aaa70703527c978cf (diff) | |
download | gtk+-4ddc94b293504b56c0106b0177c36c8efd2d3a57.tar.gz |
multipressgesture: Port to new API model
Diffstat (limited to 'gtk/gtkflowbox.c')
-rw-r--r-- | gtk/gtkflowbox.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c index a37159d32f..1c4ed8db98 100644 --- a/gtk/gtkflowbox.c +++ b/gtk/gtkflowbox.c @@ -665,7 +665,6 @@ struct _GtkFlowBoxPrivate { gpointer sort_data; GDestroyNotify sort_destroy; - GtkGesture *multipress_gesture; GtkGesture *drag_gesture; GtkEventController *key_controller; @@ -3379,7 +3378,6 @@ gtk_flow_box_finalize (GObject *obj) g_clear_object (&priv->vadjustment); g_object_unref (priv->drag_gesture); - g_object_unref (priv->multipress_gesture); g_object_unref (priv->key_controller); if (priv->bound_model) @@ -3727,6 +3725,7 @@ static void gtk_flow_box_init (GtkFlowBox *box) { GtkFlowBoxPrivate *priv = BOX_PRIV (box); + GtkGesture *gesture; gtk_widget_set_has_surface (GTK_WIDGET (box), FALSE); @@ -3741,21 +3740,22 @@ gtk_flow_box_init (GtkFlowBox *box) priv->children = g_sequence_new (NULL); - priv->multipress_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (box)); - gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (priv->multipress_gesture), + gesture = gtk_gesture_multi_press_new (); + gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE); - gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->multipress_gesture), + gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_PRIMARY); - gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->multipress_gesture), + gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); - g_signal_connect (priv->multipress_gesture, "pressed", + g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_flow_box_multipress_gesture_pressed), box); - g_signal_connect (priv->multipress_gesture, "released", + g_signal_connect (gesture, "released", G_CALLBACK (gtk_flow_box_multipress_gesture_released), box); - g_signal_connect (priv->multipress_gesture, "stopped", + g_signal_connect (gesture, "stopped", G_CALLBACK (gtk_flow_box_multipress_gesture_stopped), box); - g_signal_connect (priv->multipress_gesture, "unpaired-release", + g_signal_connect (gesture, "unpaired-release", G_CALLBACK (gtk_flow_box_multipress_unpaired_release), box); + gtk_widget_add_controller (GTK_WIDGET (box), GTK_EVENT_CONTROLLER (gesture)); priv->drag_gesture = gtk_gesture_drag_new (GTK_WIDGET (box)); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (priv->drag_gesture), |