button: Add private api to get the gesture

This may be used by subclasses who need to group
their gestures with the button gesture.
This commit is contained in:
Matthias Clasen
2017-12-10 21:24:29 -05:00
parent 4b53a17555
commit e7f85dab5a
2 changed files with 9 additions and 1 deletions

View File

@@ -435,7 +435,6 @@ gtk_button_init (GtkButton *button)
g_signal_connect (priv->gesture, "update", G_CALLBACK (multipress_gesture_update_cb), button);
g_signal_connect (priv->gesture, "cancel", G_CALLBACK (multipress_gesture_cancel_cb), button);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->gesture), GTK_PHASE_CAPTURE);
}
static void
@@ -1146,3 +1145,11 @@ gtk_button_get_icon_name (GtkButton *button)
return NULL;
}
GtkGesture *
gtk_button_get_gesture (GtkButton *button)
{
GtkButtonPrivate *priv = gtk_button_get_instance_private (button);
return priv->gesture;
}

View File

@@ -41,6 +41,7 @@ struct _GtkButtonPrivate
guint child_type : 2;
};
GtkGesture *gtk_button_get_gesture (GtkButton *button);
G_END_DECLS