[gnome-terminal] search: Close the dialog on Escape key
- From: Egmont Koblinger <egmontkob src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal] search: Close the dialog on Escape key
- Date: Sun, 17 Dec 2017 20:57:53 +0000 (UTC)
commit dbe6749869be3fed9c3099613001d9e9ecd9d70d
Author: Egmont Koblinger <egmont gmail com>
Date: Sun Dec 17 21:54:57 2017 +0100
search: Close the dialog on Escape key
https://bugzilla.gnome.org/show_bug.cgi?id=771165
src/terminal-search-popover.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/terminal-search-popover.c b/src/terminal-search-popover.c
index 4583a4f..81979b2 100644
--- a/src/terminal-search-popover.c
+++ b/src/terminal-search-popover.c
@@ -242,6 +242,18 @@ search_button_clicked_cb (GtkWidget *button,
perform_search (popover, button == priv->search_prev_button);
}
+static gboolean
+key_press_cb (GtkWidget *popover,
+ GdkEventKey *event,
+ gpointer user_data G_GNUC_UNUSED)
+{
+ if (event->keyval == GDK_KEY_Escape) {
+ gtk_widget_hide (popover);
+ return TRUE;
+ }
+ return FALSE;
+}
+
static void
update_regex (TerminalSearchPopover *popover)
{
@@ -395,6 +407,8 @@ terminal_search_popover_init (TerminalSearchPopover *popover)
g_signal_connect (priv->regex_checkbutton, "toggled", G_CALLBACK (search_parameters_changed_cb), popover);
g_signal_connect (priv->wrap_around_checkbutton, "toggled", G_CALLBACK (wrap_around_toggled_cb), popover);
+
+ g_signal_connect (popover, "key-press-event", G_CALLBACK (key_press_cb), NULL);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]