[gtk/shortcuts-rebased-again: 55/145] infobar: Port bindings to use shortcuts



commit ade06e83823cdb76d793625d7207ce4e5525b4e7
Author: Benjamin Otte <otte redhat com>
Date:   Sun Aug 12 16:57:37 2018 +0200

    infobar: Port bindings to use shortcuts

 gtk/gtkinfobar.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkinfobar.c b/gtk/gtkinfobar.c
index 2e52a5838d..a06f517d1d 100644
--- a/gtk/gtkinfobar.c
+++ b/gtk/gtkinfobar.c
@@ -39,7 +39,6 @@
 #include "gtklabel.h"
 #include "gtkbutton.h"
 #include "gtkenums.h"
-#include "gtkbindings.h"
 #include "gtkdialog.h"
 #include "gtkrevealer.h"
 #include "gtkintl.h"
@@ -323,12 +322,8 @@ gtk_info_bar_close (GtkInfoBar *info_bar)
 static void
 gtk_info_bar_class_init (GtkInfoBarClass *klass)
 {
-  GtkWidgetClass *widget_class;
-  GObjectClass *object_class;
-  GtkBindingSet *binding_set;
-
-  widget_class = GTK_WIDGET_CLASS (klass);
-  object_class = G_OBJECT_CLASS (klass);
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
   object_class->get_property = gtk_info_bar_get_property;
   object_class->set_property = gtk_info_bar_set_property;
@@ -407,9 +402,10 @@ gtk_info_bar_class_init (GtkInfoBarClass *klass)
                                   NULL,
                                   G_TYPE_NONE, 0);
 
-  binding_set = gtk_binding_set_by_class (klass);
-
-  gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "close", 0);
+  gtk_widget_class_add_binding_signal (widget_class,
+                                       GDK_KEY_Escape, 0,
+                                       "close",
+                                       NULL);
 
   /* Bind class to template
    */


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