diff --git a/src/track.rs b/src/track.rs index 2ce1a08..0af73cf 100644 --- a/src/track.rs +++ b/src/track.rs @@ -263,6 +263,11 @@ impl ListItem for Track { queue.clone(), library.clone(), ) + .set_title(format!( + "Similar to \"{} - {}\"", + self.artists.join(", "), + self.title + )) .as_boxed_view_ext() }) } diff --git a/src/ui/listview.rs b/src/ui/listview.rs index 522b633..e06a8d5 100644 --- a/src/ui/listview.rs +++ b/src/ui/listview.rs @@ -106,6 +106,7 @@ pub struct ListView { queue: Arc, library: Arc, pagination: Pagination, + title: String, } impl ListView { @@ -122,9 +123,15 @@ impl ListView { queue, library, pagination: Pagination::default(), + title: "".to_string(), } } + pub fn set_title(mut self, title: String) -> Self { + self.title = title; + self + } + pub fn get_pagination(&self) -> &Pagination { &self.pagination } @@ -433,6 +440,10 @@ impl View for ListView { } impl ViewExt for ListView { + fn title(&self) -> String { + self.title.clone() + } + fn on_command(&mut self, _s: &mut Cursive, cmd: &Command) -> Result { match cmd { Command::Play => {