[gnome-music/wip/jfelder/selection-misc-cleanups: 8/20] searchview: Do not change selection-mode if the view is not visible



commit 6ef929c6a755272e846f09bd96601559b85ec71b
Author: Jean Felder <jfelder src gnome org>
Date:   Fri Jan 10 13:19:22 2020 +0100

    searchview: Do not change selection-mode if the view is not visible
    
    A user can only select songs, artists or albums if the view is
    visible.

 gnomemusic/views/searchview.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/views/searchview.py b/gnomemusic/views/searchview.py
index b4f4576f..ec2940e4 100644
--- a/gnomemusic/views/searchview.py
+++ b/gnomemusic/views/searchview.py
@@ -424,7 +424,8 @@ class SearchView(Gtk.Stack):
 
     @log
     def _on_selection_mode_changed(self, widget, data=None):
-        if not self.props.selection_mode:
+        if (not self.props.selection_mode
+                and self.get_parent().get_visible_child() == self):
             self.unselect_all()
 
     @log


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