diff options
author | TingPing <tngpng@gmail.com> | 2013-03-17 16:16:46 -0700 |
---|---|---|
committer | TingPing <tngpng@gmail.com> | 2013-03-17 16:16:46 -0700 |
commit | 20e352217731a13a7674d5a962e6d7e8bef49423 (patch) | |
tree | 5edcfdc924f26e6b8fa4823ae56a12ce63d9c5da /src/fe-gtk/search.c | |
parent | 89d62ee4f8e563fe083b7d6132768cc5c8c63910 (diff) | |
parent | c9540df92d70025b0ec9a66e2a21cbae7c97bd26 (diff) |
Merge pull request #455 from RichardHitt/escape
Let the ESC key close certain windows. Closes #211
Diffstat (limited to 'src/fe-gtk/search.c')
-rw-r--r-- | src/fe-gtk/search.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/fe-gtk/search.c b/src/fe-gtk/search.c index 41a1a642..f2940e70 100644 --- a/src/fe-gtk/search.c +++ b/src/fe-gtk/search.c @@ -32,7 +32,6 @@ #include <gtk/gtkvseparator.h> #include <gtk/gtkradiobutton.h> #include <gtk/gtktogglebutton.h> -#include <gdk/gdkkeysyms.h> #include "../common/hexchat.h" #include "../common/fe.h" @@ -119,14 +118,6 @@ search_entry_cb (GtkWidget * entry, session * sess) search_search (sess, gtk_entry_get_text (GTK_ENTRY (entry))); } -static gboolean -search_key_cb (GtkWidget * window, GdkEventKey * key, gpointer userdata) -{ - if (key->keyval == GDK_Escape) - gtk_widget_destroy (window); - return FALSE; -} - static void search_caseign_cb (GtkToggleButton * but, session * sess) { @@ -238,7 +229,7 @@ search_open (session * sess) add_tip (wid, "Close this box, reset highlighted search items, and stop searching new lines."); /* Add recognition of the ESC key to close the box */ - g_signal_connect (G_OBJECT (win), "key_press_event", G_CALLBACK (search_key_cb), win); + gtkutil_destroy_on_esc (win); /* That's all, folks */ searchwin = win; |