From 25ac75586b728ba8f23882e30b2b938f7cb4e78f Mon Sep 17 00:00:00 2001 From: Lucian Langa Date: Sat, 3 Oct 2009 23:00:58 -0400 Subject: Bug 597224 - Cannot close preferences window with escape key --- widgets/misc/e-preferences-window.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'widgets/misc/e-preferences-window.c') diff --git a/widgets/misc/e-preferences-window.c b/widgets/misc/e-preferences-window.c index 52bda8eeac..f40dee180b 100644 --- a/widgets/misc/e-preferences-window.c +++ b/widgets/misc/e-preferences-window.c @@ -22,6 +22,7 @@ #include "e-preferences-window.h" #include +#include #include #define SWITCH_PAGE_INTERVAL 250 @@ -199,6 +200,7 @@ preferences_window_init (EPreferencesWindow *window) GtkWidget *widget; GHashTable *index; const gchar *title; + GtkAccelGroup *accel_group; index = g_hash_table_new_full ( g_str_hash, g_str_equal, @@ -287,6 +289,12 @@ preferences_window_init (EPreferencesWindow *window) G_CALLBACK (gtk_widget_hide), window); GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_DEFAULT); gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); + accel_group = gtk_accel_group_new (); + gtk_widget_add_accelerator ( + widget, "activate", accel_group, + GDK_Escape, (GdkModifierType) 0, + GTK_ACCEL_VISIBLE); + gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); gtk_widget_grab_default (widget); gtk_widget_show (widget); } -- cgit v1.2.3