[gnome-music/wip/jfelder/selection-mode-and-search: 1/2] window: Do not start search when selection-mode is active




commit 9b8d2b308ef9654947831cd7b8d8f87913db8039
Author: Jean Felder <jfelder src gnome org>
Date:   Wed Aug 19 13:43:20 2020 +0200

    window: Do not start search when selection-mode is active
    
    The search entry is a top-bar element, it is not visible when the
    application is in selection-mode state. Thus, it should not be
    possible to start a search when selection-mode is active.
    
    Related: #405

 gnomemusic/window.py | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 2f69c23e..0934e5bb 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -298,6 +298,7 @@ class Window(Gtk.ApplicationWindow):
             # Open search bar on Ctrl + F
             if (keyval == Gdk.KEY_f
                     and not self.views[View.PLAYLIST].rename_active
+                    and not self.props.selection_mode
                     and self._headerbar.props.state != HeaderBar.State.SEARCH):
                 search_mode = self._search.props.search_mode_active
                 self._search.props.search_mode_active = not search_mode
@@ -380,6 +381,7 @@ class Window(Gtk.ApplicationWindow):
                 and (modifiers == shift_mask
                      or modifiers == 0)
                 and not self.views[View.PLAYLIST].rename_active
+                and not self.props.selection_mode
                 and self._headerbar.props.state != HeaderBar.State.SEARCH):
             self._search.props.search_mode_active = True
 


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