[gtk/shortcuts-rebased-again: 33/135] shortcutssection: Port bindings to use shortcuts



commit 07d59c70b42d5ce716d7545958091917096f7cdc
Author: Benjamin Otte <otte redhat com>
Date:   Sun Aug 12 15:42:01 2018 +0200

    shortcutssection: Port bindings to use shortcuts

 gtk/gtkshortcutssection.c | 36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)
---
diff --git a/gtk/gtkshortcutssection.c b/gtk/gtkshortcutssection.c
index 1837660a01..84ccffd274 100644
--- a/gtk/gtkshortcutssection.c
+++ b/gtk/gtkshortcutssection.c
@@ -29,7 +29,6 @@
 #include "gtkorientable.h"
 #include "gtksizegroup.h"
 #include "gtkwidget.h"
-#include "gtkbindings.h"
 #include "gtkprivate.h"
 #include "gtkmarshalers.h"
 #include "gtkgesturepan.h"
@@ -306,7 +305,6 @@ gtk_shortcuts_section_class_init (GtkShortcutsSectionClass *klass)
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
   GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
-  GtkBindingSet *binding_set;
 
   object_class->finalize = gtk_shortcuts_section_finalize;
   object_class->get_property = gtk_shortcuts_section_get_property;
@@ -387,23 +385,23 @@ gtk_shortcuts_section_class_init (GtkShortcutsSectionClass *klass)
                   G_TYPE_BOOLEAN, 1,
                   G_TYPE_INT);
 
-  binding_set = gtk_binding_set_by_class (klass);
-  gtk_binding_entry_add_signal (binding_set,
-                                GDK_KEY_Page_Up, 0,
-                                "change-current-page", 1,
-                                G_TYPE_INT, -1);
-  gtk_binding_entry_add_signal (binding_set,
-                                GDK_KEY_Page_Down, 0,
-                                "change-current-page", 1,
-                                G_TYPE_INT, 1);
-  gtk_binding_entry_add_signal (binding_set,
-                                GDK_KEY_Page_Up, GDK_CONTROL_MASK,
-                                "change-current-page", 1,
-                                G_TYPE_INT, -1);
-  gtk_binding_entry_add_signal (binding_set,
-                                GDK_KEY_Page_Down, GDK_CONTROL_MASK,
-                                "change-current-page", 1,
-                                G_TYPE_INT, 1);
+  gtk_widget_class_add_binding_signal (widget_class,
+                                       GDK_KEY_Page_Up, 0,
+                                       "change-current-page",
+                                       "(i)", -1);
+  gtk_widget_class_add_binding_signal (widget_class,
+                                       GDK_KEY_Page_Down, 0,
+                                       "change-current-page",
+                                       "(i)", 1);
+  gtk_widget_class_add_binding_signal (widget_class,
+                                       GDK_KEY_Page_Up, GDK_CONTROL_MASK,
+                                       "change-current-page",
+                                       "(i)", -1);
+  gtk_widget_class_add_binding_signal (widget_class,
+                                       GDK_KEY_Page_Down, GDK_CONTROL_MASK,
+                                       "change-current-page",
+                                       "(i)", 1);
+
   gtk_widget_class_set_css_name (widget_class, I_("shortcuts-section"));
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]