[gnome-music/wip/jfelder/baseview-must-die] songsview: Remove unneeded GtkBox



commit da3f3654ce86d234d61e74a43fb9ee23a7f00d6a
Author: Marinus Schraal <mschraal gnome org>
Date:   Wed May 27 15:50:25 2020 +0200

    songsview: Remove unneeded GtkBox

 data/ui/SongsView.ui          | 177 ++++++++++++++++++++----------------------
 gnomemusic/views/songsview.py |   2 +-
 2 files changed, 87 insertions(+), 92 deletions(-)
---
diff --git a/data/ui/SongsView.ui b/data/ui/SongsView.ui
index 8a3f71fb..223df375 100644
--- a/data/ui/SongsView.ui
+++ b/data/ui/SongsView.ui
@@ -1,122 +1,117 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="3.18"/>
-  <template class="SongsView" parent="GtkBox">
+  <template class="SongsView" parent="GtkScrolledWindow">
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
     <property name="visible">True</property>
     <child>
-      <object class="GtkScrolledWindow">
-        <property name="hexpand">True</property>
-        <property name="vexpand">True</property>
+      <object class="GtkTreeView" id="_songs_view">
+        <property name="activate-on-single-click">True</property>
+        <property name="headers_visible">False</property>
+        <property name="valign">start</property>
         <property name="visible">True</property>
+        <signal name="row-activated" handler="_on_item_activated" swapped="no"/>
+        <style>
+          <class name="songs-list-old"/>
+        </style>
+        <child internal-child="selection">
+          <object class="GtkTreeSelection">
+            <property name="mode">single</property>
+          </object>
+        </child>
         <child>
-          <object class="GtkTreeView" id="_songs_view">
-            <property name="activate-on-single-click">True</property>
-            <property name="headers_visible">False</property>
-            <property name="valign">start</property>
+          <object class="GtkTreeViewColumn" id="_now_playing_column">
+            <property name="fixed_width">48</property>
             <property name="visible">True</property>
-            <signal name="row-activated" handler="_on_item_activated" swapped="no"/>
-            <style>
-              <class name="songs-list-old"/>
-            </style>
-            <child internal-child="selection">
-              <object class="GtkTreeSelection">
-                <property name="mode">single</property>
-              </object>
-            </child>
             <child>
-              <object class="GtkTreeViewColumn" id="_now_playing_column">
-                <property name="fixed_width">48</property>
-                <property name="visible">True</property>
-                <child>
-                  <object class="GtkCellRendererPixbuf" id="_now_playing_cell">
-                    <property name="xalign">0.5</property>
-                    <property name="xpad">0</property>
-                    <property name="yalign">0.5</property>
-                  </object>
-                </child>
-              </object>
-            </child>
-            <child>
-              <object class="GtkTreeViewColumn" id="_selection_column">
-                <property name="fixed_width">48</property>
-                <property name="visible">False</property>
-                <child>
-                  <object class="GtkCellRendererToggle">
-                  </object>
-                  <attributes>
-                    <attribute name="active">1</attribute>
-                  </attributes>
-                </child>
+              <object class="GtkCellRendererPixbuf" id="_now_playing_cell">
+                <property name="xalign">0.5</property>
+                <property name="xpad">0</property>
+                <property name="yalign">0.5</property>
               </object>
             </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkTreeViewColumn" id="_selection_column">
+            <property name="fixed_width">48</property>
+            <property name="visible">False</property>
             <child>
-              <object class="GtkTreeViewColumn" id="_title_column">
-                <property name="expand">True</property>
-                <property name="visible">True</property>
-                <child>
-                  <object class="GtkCellRendererText">
-                    <property name="ellipsize">end</property>
-                    <property name="height">48</property>
-                    <property name="xalign">0</property>
-                    <property name="xpad">0</property>
-                    <property name="yalign">0.5</property>
-                  </object>
-                  <attributes>
-                    <attribute name="text">2</attribute>
-                  </attributes>
-                </child>
+              <object class="GtkCellRendererToggle">
               </object>
+              <attributes>
+                <attribute name="active">1</attribute>
+              </attributes>
             </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkTreeViewColumn" id="_title_column">
+            <property name="expand">True</property>
+            <property name="visible">True</property>
             <child>
-              <object class="GtkTreeViewColumn" id="_artist_column">
-                <property name="expand">True</property>
-                <property name="visible">True</property>
-                <child>
-                  <object class="GtkCellRendererText">
-                    <property name="ellipsize">end</property>
-                    <property name="xpad">32</property>
-                  </object>
-                  <attributes>
-                    <attribute name="text">3</attribute>
-                  </attributes>
-                </child>
+              <object class="GtkCellRendererText">
+                <property name="ellipsize">end</property>
+                <property name="height">48</property>
+                <property name="xalign">0</property>
+                <property name="xpad">0</property>
+                <property name="yalign">0.5</property>
               </object>
+              <attributes>
+                <attribute name="text">2</attribute>
+              </attributes>
             </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkTreeViewColumn" id="_artist_column">
+            <property name="expand">True</property>
+            <property name="visible">True</property>
             <child>
-              <object class="GtkTreeViewColumn" id="_album_column">
-                <property name="expand">True</property>
-                <property name="visible">True</property>
-                <child>
-                  <object class="GtkCellRendererText">
-                    <property name="ellipsize">end</property>
-                    <property name="xpad">32</property>
-                  </object>
-                  <attributes>
-                    <attribute name="text">4</attribute>
-                  </attributes>
-                </child>
+              <object class="GtkCellRendererText">
+                <property name="ellipsize">end</property>
+                <property name="xpad">32</property>
               </object>
+              <attributes>
+                <attribute name="text">3</attribute>
+              </attributes>
             </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkTreeViewColumn" id="_album_column">
+            <property name="expand">True</property>
+            <property name="visible">True</property>
             <child>
-              <object class="GtkTreeViewColumn" id="_duration_column">
-                <property name="visible">True</property>
-                <child>
-                  <object class="GtkCellRendererText" id="_duration_renderer">
-                    <property name="xalign">1</property>
-                  </object>
-                  <attributes>
-                    <attribute name="text">5</attribute>
-                  </attributes>
-                </child>
+              <object class="GtkCellRendererText">
+                <property name="ellipsize">end</property>
+                <property name="xpad">32</property>
               </object>
+              <attributes>
+                <attribute name="text">4</attribute>
+              </attributes>
             </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkTreeViewColumn" id="_duration_column">
+            <property name="visible">True</property>
             <child>
-              <object class="GtkTreeViewColumn" id="_star_column">
-                <property name="visible">True</property>
+              <object class="GtkCellRendererText" id="_duration_renderer">
+                <property name="xalign">1</property>
               </object>
+              <attributes>
+                <attribute name="text">5</attribute>
+              </attributes>
             </child>
           </object>
         </child>
+        <child>
+          <object class="GtkTreeViewColumn" id="_star_column">
+            <property name="visible">True</property>
+          </object>
+        </child>
       </object>
     </child>
   </template>
diff --git a/gnomemusic/views/songsview.py b/gnomemusic/views/songsview.py
index aae438f9..267e39cb 100644
--- a/gnomemusic/views/songsview.py
+++ b/gnomemusic/views/songsview.py
@@ -32,7 +32,7 @@ from gnomemusic.widgets.starhandlerwidget import StarHandlerWidget
 
 
 @Gtk.Template(resource_path="/org/gnome/Music/ui/SongsView.ui")
-class SongsView(Gtk.Box):
+class SongsView(Gtk.ScrolledWindow):
     """Main view of all songs sorted artistwise
 
     Consists all songs along with songname, star, length, artist


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