This commit is contained in:
Benjamin Schaaf
2022-01-12 21:24:40 +11:00
parent 82a881ebfd
commit 4ce2f222f1

View File

@@ -121,21 +121,29 @@ class AlbumWithSongs(Gtk.Box):
)
album_details.pack_start(self.artist_and_year, False, False, 0)
details_bottom_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
self.genre_and_song_count = Gtk.Label()
details_bottom_box.pack_start(self.genre_and_song_count, False, False, 10)
squeezer = Handy.Squeezer(homogeneous=False)
details_bottom_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
self.genre_and_song_count_long = Gtk.Label()
details_bottom_box.pack_start(self.genre_and_song_count_long, False, False, 10)
self.song_duration_long = Gtk.Label(halign=Gtk.Align.END)
squeezer.add(self.song_duration_long)
details_bottom_box.pack_end(self.song_duration_long, False, False, 10)
squeezer.add(details_bottom_box)
details_bottom_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
self.genre_and_song_count_short = Gtk.Label(ellipsize=Pango.EllipsizeMode.END)
details_bottom_box.pack_start(self.genre_and_song_count_short, False, False, 10)
self.song_duration_short = Gtk.Label(halign=Gtk.Align.END)
squeezer.add(self.song_duration_short)
details_bottom_box.pack_end(self.song_duration_short, False, False, 10)
details_bottom_box.pack_end(squeezer, False, False, 20)
album_details.pack_start(details_bottom_box, False, False, 0)
squeezer.add(details_bottom_box)
album_details.pack_start(squeezer, False, False, 0)
self.loading_indicator_container = Gtk.Box()
album_details.pack_start(self.loading_indicator_container, False, False, 0)
@@ -279,10 +287,14 @@ class AlbumWithSongs(Gtk.Box):
artist = album.artist.name if self.show_artist_name and album.artist else None
self.artist_and_year.set_label(util.dot_join(artist, album.year))
self.genre_and_song_count.set_label(util.dot_join(
self.genre_and_song_count_long.set_label(util.dot_join(
f"{album.song_count} " + util.pluralize("song", album.song_count),
album.genre.name if album.genre else None))
self.genre_and_song_count_short.set_label(util.dot_join(
f"{album.song_count}",
album.genre.name if album.genre else None))
self.song_duration_long.set_label(
util.format_sequence_duration(album.duration) if album.duration else "")