[gnome-tweak-tool] AppChooser: Rationalize ‘Escap e’ handling



commit 019eda92b5bf2fe9bcc59db76b2f79808f266744
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 634612f..01f7a3a 100644
--- a/gtweak/tweaks/tweak_group_startup.py
+++ b/gtweak/tweaks/tweak_group_startup.py
@@ -158,13 +158,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]