diff options
author | Benjamin Otte <otte@redhat.com> | 2018-03-09 00:03:15 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2018-04-26 17:59:41 +0200 |
commit | 71991270b047c66e7c14a65aaa70703527c978cf (patch) | |
tree | 8b3b746c11745757c845cfda845dc74f8c2e2a0e /gtk/gtkshortcutssection.c | |
parent | 66223aaa08e2343eebe6a6b241212aaa5a237b14 (diff) | |
download | gtk+-71991270b047c66e7c14a65aaa70703527c978cf.tar.gz |
pangesture: Port to new API model
Diffstat (limited to 'gtk/gtkshortcutssection.c')
-rw-r--r-- | gtk/gtkshortcutssection.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk/gtkshortcutssection.c b/gtk/gtkshortcutssection.c index be60ba3799..885d3665a2 100644 --- a/gtk/gtkshortcutssection.c +++ b/gtk/gtkshortcutssection.c @@ -70,8 +70,6 @@ struct _GtkShortcutsSection gboolean has_filtered_group; gboolean need_reflow; - - GtkGesture *pan_gesture; }; struct _GtkShortcutsSectionClass @@ -232,7 +230,6 @@ gtk_shortcuts_section_finalize (GObject *object) g_clear_pointer (&self->name, g_free); g_clear_pointer (&self->title, g_free); g_clear_pointer (&self->view_name, g_free); - g_clear_object (&self->pan_gesture); G_OBJECT_CLASS (gtk_shortcuts_section_parent_class)->finalize (object); } @@ -417,6 +414,8 @@ gtk_shortcuts_section_class_init (GtkShortcutsSectionClass *klass) static void gtk_shortcuts_section_init (GtkShortcutsSection *self) { + GtkGesture *gesture; + self->max_height = 15; gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_VERTICAL); @@ -454,9 +453,10 @@ gtk_shortcuts_section_init (GtkShortcutsSection *self) gtk_box_pack_end (GTK_BOX (self->footer), self->show_all); gtk_widget_set_halign (self->show_all, GTK_ALIGN_END); - self->pan_gesture = gtk_gesture_pan_new (GTK_WIDGET (self->stack), GTK_ORIENTATION_HORIZONTAL); - g_signal_connect (self->pan_gesture, "pan", + gesture = gtk_gesture_pan_new (GTK_ORIENTATION_HORIZONTAL); + g_signal_connect (gesture, "pan", G_CALLBACK (gtk_shortcuts_section_pan_gesture_pan), self); + gtk_widget_add_controller (GTK_WIDGET (self->stack), GTK_EVENT_CONTROLLER (gesture)); } static void |