[gnome-music] window: Pressing ESC disables only the selection mode



commit da809ed668f3d4f268f191d62b51e39b3466ec44
Author: rajalakshmi-v15 <raji11997 gmail com>
Date:   Fri Jun 29 01:25:48 2018 +0530

    window: Pressing ESC disables only the selection mode
    
    When selection mode and SearchView are both enabled, pressing ESC key
    leaves selection mode but the SearchView remains enabled.
    
    Closes: #195

 gnomemusic/window.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index a81ebf6f..58421e58 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -413,12 +413,12 @@ class Window(Gtk.ApplicationWindow):
             if (event.keyval == Gdk.KEY_Delete
                     and child == self.views[View.PLAYLIST]):
                 self.views[View.PLAYLIST].remove_playlist()
-            # Close search bar after Esc is pressed
+            # Close selection mode or search bar after Esc is pressed
             if event.keyval == Gdk.KEY_Escape:
-                self.headerbar.searchbar.reveal(False)
-                # Also disable selection
                 if self.headerbar.props.selection_mode:
                     self.headerbar.props.selection_mode = False
+                else:
+                    self.headerbar.searchbar.reveal(False)
 
         # Open the search bar when typing printable chars.
         key_unic = Gdk.keyval_to_unicode(event.keyval)


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