summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2018-10-05 08:35:47 (EDT)
committer P. J. McDermott <pj@pehjota.net>2018-10-05 08:35:47 (EDT)
commitdab4d96f5927fdd6d1676ee3f5e810fc7ae62272 (patch)
tree1d2f9c508da2790de8d6c5cac0990b110843cb7f
parent68b6c49983c5ba7f3863e1312532635bf3623a90 (diff)
downloadmarquee-dab4d96f5927fdd6d1676ee3f5e810fc7ae62272.zip
marquee-dab4d96f5927fdd6d1676ee3f5e810fc7ae62272.tar.gz
marquee-dab4d96f5927fdd6d1676ee3f5e810fc7ae62272.tar.bz2
MqWindow: Use MqAccelGroup
-rw-r--r--src/window.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/src/window.c b/src/window.c
index 6632305..bdf9870 100644
--- a/src/window.c
+++ b/src/window.c
@@ -26,6 +26,7 @@
#include <glib.h>
#include <gtk/gtk.h>
+#include "accel-group.h"
#include "application.h"
#include "config/config.h"
#include "i18n.h"
@@ -193,8 +194,9 @@ set_title(MqWindow *window, const gchar *title)
static void
constructed(GObject *object)
{
- MqWindow *window;
- gsize i;
+ MqWindow *window;
+ gsize i;
+ MqAccelGroup *accel_group;
window = MQ_WINDOW(object);
@@ -217,6 +219,8 @@ constructed(GObject *object)
FALSE);
}
+ accel_group = mq_accel_group_new(window);
+
gtk_widget_show_all(GTK_WIDGET(window));
}
@@ -293,25 +297,9 @@ mq_window_class_init(MqWindowClass *klass)
obj_properties);
}
-static gboolean
-accel_close_tab(G_GNUC_UNUSED GtkAccelGroup *accel_group,
- GObject *acceleratable, G_GNUC_UNUSED guint keyval,
- G_GNUC_UNUSED GdkModifierType modifier,
- G_GNUC_UNUSED gpointer user_data)
-{
- MqWindow *window;
-
- window = MQ_WINDOW(acceleratable);
-
- mq_notebook_remove_current_page(MQ_NOTEBOOK(window->notebook));
- return TRUE;
-}
-
static void
mq_window_init(MqWindow *window)
{
- GtkAccelGroup *accel_group;
-
window->fullscreen = FALSE;
g_signal_connect(window, "notify::is-maximized",
@@ -327,11 +315,6 @@ mq_window_init(MqWindow *window)
window->notebook = mq_notebook_new(window);
gtk_container_add(GTK_CONTAINER(window), window->notebook);
-
- accel_group = gtk_accel_group_new();
- gtk_accel_group_connect(accel_group, GDK_KEY_W, GDK_CONTROL_MASK, 0,
- g_cclosure_new(G_CALLBACK(accel_close_tab), NULL, NULL));
- gtk_window_add_accel_group(GTK_WINDOW(window), accel_group);
}
MqWindow *