[gnome-builder] shortcuts: close window on Escape
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] shortcuts: close window on Escape
- Date: Mon, 31 Aug 2015 11:18:18 +0000 (UTC)
commit 282bbdcde4b4765f1985685b61c2ab8131402a14
Author: Christian Hergert <christian hergert me>
Date: Mon Aug 31 04:18:10 2015 -0700
shortcuts: close window on Escape
If we are not focused in the search entry, close the window on Escape.
Two escapes will do this if you are currently focused in the search entry.
src/shortcuts/gb-shortcuts-dialog.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/shortcuts/gb-shortcuts-dialog.c b/src/shortcuts/gb-shortcuts-dialog.c
index 1fd8fe4..9f26396 100644
--- a/src/shortcuts/gb-shortcuts-dialog.c
+++ b/src/shortcuts/gb-shortcuts-dialog.c
@@ -670,6 +670,14 @@ gb_shortcuts_dialog_custom_finished (GtkBuildable *buildable,
}
static void
+gb_shortcuts_dialog_real_close (GbShortcutsDialog *self)
+{
+ g_assert (GB_IS_SHORTCUTS_DIALOG (self));
+
+ gtk_window_close (GTK_WINDOW (self));
+}
+
+static void
gb_shortcuts_dialog_constructed (GObject *object)
{
GbShortcutsDialog *self = (GbShortcutsDialog *)object;
@@ -772,6 +780,8 @@ gb_shortcuts_dialog_class_init (GbShortcutsDialogClass *klass)
container_class->add = gb_shortcuts_dialog_add;
+ klass->close = gb_shortcuts_dialog_real_close;
+
gParamSpecs [PROP_VIEW_NAME] =
g_param_spec_string ("view-name",
"ViewName",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]