[gtk+/gtk-3-18] file chooser: Make Escape close the dialog
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-18] file chooser: Make Escape close the dialog
- Date: Tue, 23 Feb 2016 12:40:32 +0000 (UTC)
commit 244ac50e981dd97858fccf22fec12a5c97118625
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jan 29 19:12:51 2016 -0500
file chooser: Make Escape close the dialog
In some situations (no header bar, save mode), hitting Escape
would not do anything because the entry ate the key event.
Fix this by telling the entry to only handle Escape when there
is something to do, such as switching back to the path bar.
https://bugzilla.gnome.org/show_bug.cgi?id=761026
gtk/gtkfilechooserwidget.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index b61c7e0..1efbff4 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -2604,7 +2604,12 @@ location_entry_create (GtkFileChooserWidget *impl)
if (!priv->location_entry)
{
- priv->location_entry = _gtk_file_chooser_entry_new (TRUE, TRUE);
+ gboolean eat_escape;
+
+ eat_escape = priv->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
+ priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER;
+
+ priv->location_entry = _gtk_file_chooser_entry_new (TRUE, eat_escape);
location_entry_setup (impl);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]