[gnome-tweak-tool/wip/pwood/app-chooser: 7/11] AppChooser : Rationalize ‘Escape’ handling



commit 23edc6b054f8a4ec2d42752c8c1bf188ba986a75
Author: Phillip Wood <phillip wood dunelm org uk>
Date:   Tue Apr 14 12:35:06 2015 +0100

    AppChooser: Rationalize ‘Escape’ handling
    
    Pressing ‘Escape’ when the search-bar is visible should close it, if the
    search-bar is not visible it should close the dialog.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747983

 gtweak/tweaks/tweak_group_startup.py |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/gtweak/tweaks/tweak_group_startup.py b/gtweak/tweaks/tweak_group_startup.py
index 92be3c8..52ef9cd 100644
--- a/gtweak/tweaks/tweak_group_startup.py
+++ b/gtweak/tweaks/tweak_group_startup.py
@@ -191,13 +191,10 @@ class _AppChooser(Gtk.Dialog):
     def _on_key_press(self, widget, event):
       keyname = Gdk.keyval_name(event.keyval)
       if keyname == 'Escape':
-          if self.entry.is_focus():
+          if self.searchbar.get_search_mode():
               self.searchbar.set_search_mode(False)
               return True
-          elif self.searchbar.get_search_mode():
-              self.entry.grab_focus()
-              return True
-      elif keyname not in ['Escape', 'Up', 'Down']:
+      elif keyname not in ['Up', 'Down']:
           if not self.entry.is_focus() and self.searchbar.get_search_mode():
               if self.entry.im_context_filter_keypress(event):
                   self.entry.grab_focus()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]