From fa97236b623eddcaee2c68e3c5f8a15ff16f3748 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 9 Mar 2018 06:07:44 +0100 Subject: [PATCH] placesviewrow: Put event controllers into ui file --- gtk/gtkplacesviewrow.c | 11 +++-------- gtk/ui/gtkplacesviewrow.ui | 6 ++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gtk/gtkplacesviewrow.c b/gtk/gtkplacesviewrow.c index c64c063523..79e30c9d7e 100644 --- a/gtk/gtkplacesviewrow.c +++ b/gtk/gtkplacesviewrow.c @@ -28,13 +28,13 @@ */ #ifdef GTK_COMPILATION #include "gtkbutton.h" +#include "gtkgesture.h" #include "gtkimage.h" #include "gtkintl.h" #include "gtklabel.h" #include "gtkspinner.h" #include "gtkstack.h" #include "gtktypebuiltins.h" -#include "gtkgesturemultipress.h" #else #include #endif @@ -56,8 +56,6 @@ struct _GtkPlacesViewRow GMount *mount; GFile *file; - GtkGesture *gesture; - GCancellable *cancellable; gint is_network : 1; @@ -216,7 +214,6 @@ gtk_places_view_row_finalize (GObject *object) g_clear_object (&self->mount); g_clear_object (&self->file); g_clear_object (&self->cancellable); - g_clear_object (&self->gesture); G_OBJECT_CLASS (gtk_places_view_row_parent_class)->finalize (object); } @@ -392,16 +389,14 @@ gtk_places_view_row_class_init (GtkPlacesViewRowClass *klass) gtk_widget_class_bind_template_child (widget_class, GtkPlacesViewRow, icon_image); gtk_widget_class_bind_template_child (widget_class, GtkPlacesViewRow, name_label); gtk_widget_class_bind_template_child (widget_class, GtkPlacesViewRow, path_label); + + gtk_widget_class_bind_template_callback (widget_class, pressed_cb); } static void gtk_places_view_row_init (GtkPlacesViewRow *self) { gtk_widget_init_template (GTK_WIDGET (self)); - - self->gesture = gtk_gesture_multi_press_new (GTK_WIDGET (self)); - gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (self->gesture), GDK_BUTTON_SECONDARY); - g_signal_connect (self->gesture, "pressed", G_CALLBACK (pressed_cb), self); } GtkWidget* diff --git a/gtk/ui/gtkplacesviewrow.ui b/gtk/ui/gtkplacesviewrow.ui index 47658fa5d1..f800d4e4e5 100644 --- a/gtk/ui/gtkplacesviewrow.ui +++ b/gtk/ui/gtkplacesviewrow.ui @@ -84,5 +84,11 @@ + + + 3 + + +