diff --git a/src/window.blp b/src/window.blp index b3f83b2..e004fb2 100644 --- a/src/window.blp +++ b/src/window.blp @@ -101,29 +101,15 @@ paintable: bind template.playing_cover_art; styles [ "heading" ] halign: start; label: bind template.song as <$Song>.title; + ellipsize: end; } Box { halign: start; Label { styles [ "caption" ] - label: bind template.song as <$Song>.artist; - } - Label { - styles [ "caption" ] - label: " - "; - } - Label { - styles [ "caption" ] - label: bind template.song as <$Song>.album; - } - Label { - styles [ "caption" ] - label: " - "; - } - Label { - styles [ "caption" ] - label: bind template.song as <$Song>.year; + label: bind $format_song_below_title (template.song) as ; + ellipsize: end; } } } diff --git a/src/window.vala b/src/window.vala index 3d8254d..c7f60f1 100644 --- a/src/window.vala +++ b/src/window.vala @@ -200,4 +200,8 @@ class Window : Adw.ApplicationWindow { [GtkCallback] private void show_setup_dialog () { this.setup.present (this); } + + [GtkCallback] private string format_song_below_title (Song? song) { + return song == null ? "" : @"$(song.artist) - $(song.album) - $(song.year)"; + } }