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/gtkcalendar.c | |
parent | 71991270b047c66e7c14a65aaa70703527c978cf (diff) | |
download | gtk+-4ddc94b293504b56c0106b0177c36c8efd2d3a57.tar.gz |
multipressgesture: Port to new API model
Diffstat (limited to 'gtk/gtkcalendar.c')
-rw-r--r-- | gtk/gtkcalendar.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index 219be68481..704ce1808d 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -249,7 +249,6 @@ struct _GtkCalendarPrivate gint detail_width_chars; gint detail_overflow[6]; - GtkGesture *press_gesture; GtkGesture *drag_gesture; GtkEventController *scroll_controller; GtkEventController *key_controller; @@ -643,6 +642,7 @@ static void gtk_calendar_init (GtkCalendar *calendar) { GtkWidget *widget = GTK_WIDGET (calendar); + GtkGesture *gesture; time_t secs; struct tm *tm; gint i; @@ -672,9 +672,10 @@ gtk_calendar_init (GtkCalendar *calendar) gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (calendar)), GTK_STYLE_CLASS_VIEW); - priv->press_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (calendar)); - g_signal_connect (priv->press_gesture, "pressed", G_CALLBACK (gtk_calendar_button_press), calendar); - g_signal_connect (priv->press_gesture, "released", G_CALLBACK (gtk_calendar_button_release), calendar); + gesture = gtk_gesture_multi_press_new (); + g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_calendar_button_press), calendar); + g_signal_connect (gesture, "released", G_CALLBACK (gtk_calendar_button_release), calendar); + gtk_widget_add_controller (GTK_WIDGET (calendar), GTK_EVENT_CONTROLLER (gesture)); priv->drag_gesture = gtk_gesture_drag_new (GTK_WIDGET (calendar)); g_signal_connect (priv->drag_gesture, "drag-begin", G_CALLBACK (gtk_calendar_drag_begin), calendar); @@ -1332,7 +1333,6 @@ gtk_calendar_finalize (GObject *object) { GtkCalendarPrivate *priv = GTK_CALENDAR (object)->priv; - g_object_unref (priv->press_gesture); g_object_unref (priv->drag_gesture); g_object_unref (priv->scroll_controller); g_object_unref (priv->key_controller); |