[gnome-music/wip/mschraal/selection-fixes: 4/4] artistview: Avoid initial row activation selection



commit 65f6ee04689cb97a41a9c7ab746c0772f6a4a76d
Author: Marinus Schraal <mschraal gnome org>
Date:   Fri Oct 4 16:33:06 2019 +0200

    artistview: Avoid initial row activation selection
    
    On initial start the first row of ArtistsView is activated. If this
    occurs while another view is in selection mode, all items of the first
    row (artist) will be selected.
    
    Use Window's active-view property to check if ArtistView is the active
    view while a selection is being made.

 gnomemusic/views/artistsview.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/views/artistsview.py b/gnomemusic/views/artistsview.py
index 76f928b6..07398bc9 100644
--- a/gnomemusic/views/artistsview.py
+++ b/gnomemusic/views/artistsview.py
@@ -142,7 +142,8 @@ class ArtistsView(BaseView):
     def _on_artist_activated(self, sidebar, row, data=None):
         """Initializes new artist album widgets"""
         artist_tile = row.get_child()
-        if self.props.selection_mode:
+        if (self.props.selection_mode
+                and self._window.props.active_view is self):
             artist_tile.props.selected = not artist_tile.props.selected
             return
 


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