[gnome-music/wip/jfelder/baseview-must-die: 3/7] songsview: Remove unneeded GtkStack
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/baseview-must-die: 3/7] songsview: Remove unneeded GtkStack
- Date: Sat, 30 May 2020 12:24:22 +0000 (UTC)
commit fd54c3d419ac184ef7ce8bbd4d95db7e96320f34
Author: Marinus Schraal <mschraal gnome org>
Date: Tue May 26 23:05:13 2020 +0200
songsview: Remove unneeded GtkStack
There is no point in using GtkStack.
data/ui/SongsView.ui | 177 ++++++++++++++++++++----------------------
gnomemusic/views/songsview.py | 4 +-
2 files changed, 88 insertions(+), 93 deletions(-)
---
diff --git a/data/ui/SongsView.ui b/data/ui/SongsView.ui
index 382efb01..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="GtkStack">
+ <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 7e1954e5..03dc1ae0 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.Stack):
+class SongsView(Gtk.ScrolledWindow):
"""Main view of all songs sorted artistwise
Consists all songs along with songname, star, length, artist
@@ -53,7 +53,7 @@ class SongsView(Gtk.Stack):
:param GtkApplication window: The application object
"""
- super().__init__(transition_type=Gtk.StackTransitionType.CROSSFADE)
+ super().__init__()
# FIXME: Make these properties.
self.name = "songs"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]