[gnome-music/wip/jfelder/baseview-must-die: 1/7] artistsview: Remove unneeded GtkStack



commit 89ce7e2bbf462e59404100c53299ffa77745ad13
Author: Marinus Schraal <mschraal gnome org>
Date:   Tue May 26 23:02:44 2020 +0200

    artistsview: Remove unneeded GtkStack
    
    There is no point in using a GtkStack.

 data/ui/ArtistsView.ui          | 43 ++++++++++++++++++-----------------------
 gnomemusic/views/artistsview.py |  4 ++--
 2 files changed, 21 insertions(+), 26 deletions(-)
---
diff --git a/data/ui/ArtistsView.ui b/data/ui/ArtistsView.ui
index c43adfb4..cce0e7be 100644
--- a/data/ui/ArtistsView.ui
+++ b/data/ui/ArtistsView.ui
@@ -1,39 +1,34 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="3.18"/>
-  <template class="ArtistsView" parent="GtkStack">
+  <template class="ArtistsView" parent="GtkBox">
     <property name="visible">True</property>
     <child>
-      <object class="GtkBox">
+      <object class="GtkScrolledWindow">
         <property name="visible">True</property>
+        <property name="width_request">220</property>
+        <style>
+          <class name="sidebar"/>
+        </style>
         <child>
-          <object class="GtkScrolledWindow">
+          <object class="GtkListBox" id="_sidebar">
+            <property name="selection_mode">single</property>
             <property name="visible">True</property>
-            <property name="width_request">220</property>
-            <style>
-              <class name="sidebar"/>
-            </style>
-            <child>
-              <object class="GtkListBox" id="_sidebar">
-                <property name="selection_mode">single</property>
-                <property name="visible">True</property>
-                <signal name="row-activated" handler="_on_artist_activated" swapped="no"/>
-              </object>
-            </child>
+            <signal name="row-activated" handler="_on_artist_activated" swapped="no"/>
           </object>
         </child>
+      </object>
+    </child>
+    <child>
+      <object class="GtkScrolledWindow" id="_artist_container">
+        <property name="hexpand">True</property>
+        <property name="vexpand">True</property>
+        <property name="visible">True</property>
         <child>
-          <object class="GtkScrolledWindow" id="_artist_container">
-            <property name="hexpand">True</property>
-            <property name="vexpand">True</property>
+          <object class="GtkStack" id="_artist_view">
+            <property name="transition-type">crossfade</property>
+            <property name="vhomogeneous">False</property>
             <property name="visible">True</property>
-            <child>
-              <object class="GtkStack" id="_artist_view">
-                <property name="transition-type">crossfade</property>
-                <property name="vhomogeneous">False</property>
-                <property name="visible">True</property>
-              </object>
-            </child>
           </object>
         </child>
       </object>
diff --git a/gnomemusic/views/artistsview.py b/gnomemusic/views/artistsview.py
index 77334963..908f5391 100644
--- a/gnomemusic/views/artistsview.py
+++ b/gnomemusic/views/artistsview.py
@@ -30,7 +30,7 @@ from gnomemusic.widgets.artisttile import ArtistTile
 
 
 @Gtk.Template(resource_path="/org/gnome/Music/ui/ArtistsView.ui")
-class ArtistsView(Gtk.Stack):
+class ArtistsView(Gtk.Box):
     """Main view of all available artists
 
     Consists of a list of artists on the left side and an overview of
@@ -48,7 +48,7 @@ class ArtistsView(Gtk.Stack):
 
         :param GtkApplication application: The application object
         """
-        super().__init__(transition_type=Gtk.StackTransitionType.CROSSFADE)
+        super().__init__()
 
         # FIXME: Make these properties.
         self.name = "artists"


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