From 4ce2f222f13020574d54110d90839f48d8689b9d Mon Sep 17 00:00:00 2001 From: Benjamin Schaaf Date: Wed, 12 Jan 2022 21:24:40 +1100 Subject: [PATCH] WIP --- sublime_music/ui/common/album_with_songs.py | 32 ++++++++++++++------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/sublime_music/ui/common/album_with_songs.py b/sublime_music/ui/common/album_with_songs.py index 3988429..ad9d928 100644 --- a/sublime_music/ui/common/album_with_songs.py +++ b/sublime_music/ui/common/album_with_songs.py @@ -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 "")