[gnome-music/wip/jfelder/fix-critical-widget-realized: 1/3] artisttile: Directly inherit from GtkListBoxRow



commit bf5287bc7f0d5b47ea0f5b5ff139b8460d9b68b1
Author: Jean Felder <jfelder src gnome org>
Date:   Wed Jan 8 17:53:00 2020 +0100

    artisttile: Directly inherit from GtkListBoxRow

 data/ui/ArtistTile.ui            | 2 +-
 gnomemusic/views/artistsview.py  | 5 ++---
 gnomemusic/widgets/artisttile.py | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/data/ui/ArtistTile.ui b/data/ui/ArtistTile.ui
index 6c75c483..2745fc3e 100644
--- a/data/ui/ArtistTile.ui
+++ b/data/ui/ArtistTile.ui
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <template class="ArtistTile" parent="GtkEventBox">
+  <template class="ArtistTile" parent="GtkListBoxRow">
     <property name="can_focus">False</property>
     <property name="visible">True</property>
     <child>
diff --git a/gnomemusic/views/artistsview.py b/gnomemusic/views/artistsview.py
index 4c761c35..0708251b 100644
--- a/gnomemusic/views/artistsview.py
+++ b/gnomemusic/views/artistsview.py
@@ -141,7 +141,6 @@ class ArtistsView(BaseView):
     @log
     def _on_artist_activated(self, sidebar, row, data=None):
         """Initializes new artist album widgets"""
-        artist_tile = row.get_child()
         # On application start the first row of ArtistView is activated
         # to show an intial artist. When this happens while any of the
         # views are in selection mode, this artist will be incorrectly
@@ -150,11 +149,11 @@ class ArtistsView(BaseView):
         # ArtistsView, to circumvent this issue.
         if (self.props.selection_mode
                 and self._window.props.active_view is self):
-            artist_tile.props.selected = not artist_tile.props.selected
+            row.props.selected = not row.props.selected
             return
 
         # Prepare a new artist_albums_widget here
-        coreartist = artist_tile.props.coreartist
+        coreartist = row.props.coreartist
         if coreartist.props.artist in self._loaded_artists:
             scroll_vadjustment = self._view_container.props.vadjustment
             scroll_vadjustment.props.value = 0.
diff --git a/gnomemusic/widgets/artisttile.py b/gnomemusic/widgets/artisttile.py
index c762b1fd..577349f1 100644
--- a/gnomemusic/widgets/artisttile.py
+++ b/gnomemusic/widgets/artisttile.py
@@ -29,7 +29,7 @@ from gnomemusic.coreartist import CoreArtist
 
 
 @Gtk.Template(resource_path='/org/gnome/Music/ui/ArtistTile.ui')
-class ArtistTile(Gtk.EventBox):
+class ArtistTile(Gtk.ListBoxRow):
     """Row for sidebars
 
     Contains a label and an optional checkbox.


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