Commit ea702d09 authored by Jean Felder's avatar Jean Felder Committed by Marinus Schraal

songwidget: Disable sizegroup when artist and album are hidden

parent 1270e050
......@@ -90,15 +90,15 @@
</object>
</child>
<child>
<object class="GtkBox" id="artist_box">
<property name="visible">True</property>
<object class="GtkBox" id="_artist_box">
<property name="visible">False</property>
<property name="can_focus">False</property>
<property name="margin_top">1</property>
<property name="margin_bottom">1</property>
<property name="hexpand">True</property>
<child>
<object class="GtkLabel" id="_artist_label">
<property name="visible">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="halign">start</property>
......@@ -113,7 +113,7 @@
</object>
</child>
<child>
<object class="GtkBox" id="album_duration_box">
<object class="GtkBox" id="_album_duration_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">1</property>
......@@ -174,12 +174,12 @@
</object>
</child>
</template>
<object class="GtkSizeGroup">
<object class="GtkSizeGroup" id="_size_group">
<property name="mode">horizontal</property>
<widgets>
<widget name="title_box"/>
<widget name="artist_box"/>
<widget name="album_duration_box"/>
<widget name="_artist_box"/>
<widget name="_album_duration_box"/>
</widgets>
</object>
</interface>
......@@ -65,6 +65,8 @@ class SongWidget(Gtk.EventBox):
_playlists = Playlists.get_default()
_album_label = Gtk.Template.Child()
_album_duration_box = Gtk.Template.Child()
_artist_box = Gtk.Template.Child()
_artist_label = Gtk.Template.Child()
_dnd_eventbox = Gtk.Template.Child()
_select_button = Gtk.Template.Child()
......@@ -74,6 +76,7 @@ class SongWidget(Gtk.EventBox):
_star_eventbox = Gtk.Template.Child()
_star_image = Gtk.Template.Child()
_play_icon = Gtk.Template.Child()
_size_group = Gtk.Template.Child()
class State(IntEnum):
"""The state of the SongWidget
......@@ -119,7 +122,9 @@ class SongWidget(Gtk.EventBox):
self._album_label.props.visible = True
artist = self.props.coresong.props.artist
self._artist_label.props.label = artist
self._artist_label.props.visible = True
self._artist_box.props.visible = True
else:
self._size_group.remove_widget(self._album_duration_box)
self._select_button.set_visible(False)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment