Use ViewExt.title() in TabView

Instead of storing a separate copy of the view title.

Additionally, rename `ViewExt.set_title()` to `ViewExt.with_title()` as it
consumes `self` and returns ownership.
This commit is contained in:
Henrik Friedrichsen
2022-08-19 20:42:46 +02:00
parent 5db79d5b2e
commit 38dfba1db5
11 changed files with 39 additions and 40 deletions

View File

@@ -277,7 +277,7 @@ impl ListItem for Album {
queue.clone(),
library.clone(),
)
.set_title(format!("Similar to Album \"{}\"", self.title))
.with_title(&format!("Similar to Album \"{}\"", self.title))
.into_boxed_view_ext()
})
}

View File

@@ -191,7 +191,7 @@ impl ListItem for Artist {
queue.clone(),
library.clone(),
)
.set_title(format!("Similar to Artist \"{}\"", self.name,))
.with_title(&format!("Similar to Artist \"{}\"", self.name))
.into_boxed_view_ext()
})
}

View File

@@ -312,7 +312,7 @@ impl ListItem for Playlist {
queue.clone(),
library.clone(),
)
.set_title(format!("Similar to Tracks in \"{}\"", self.name,))
.with_title(&format!("Similar to Tracks in \"{}\"", self.name))
.into_boxed_view_ext()
})
}

View File

@@ -295,7 +295,7 @@ impl ListItem for Track {
queue.clone(),
library.clone(),
)
.set_title(format!(
.with_title(&format!(
"Similar to \"{} - {}\"",
self.artists.join(", "),
self.title