fix(slint): artist view album covers + bio Read-more toggle
Artist release cards were rendered with empty artwork because no artwork-pipeline target existed for ArtistState. Added ArtworkTarget::ArtistRelease and an artist::artwork_jobs builder; navigate_artist now spawns the cover-download jobs after applying the page data, so every section grid fills in progressively. Biography truncation: artist.rs precomputes a word-boundary bio_short (360 chars), ArtistState exposes bio-short and bio-truncated, and ArtistPageView shows the short variant with an inline Read more / Read less toggle. cc
This commit is contained in:
5 files changed
+92
-2
No files matched your search
@@ -170,6 +170,9 @@ export component ArtistPageView inherits Rectangle {
|
||||
callback open-album(string);
|
||||
callback media-action(string, string, string);
|
||||
|
||||
// Read-more toggle for the biography.
|
||||
property <bool> bio-expanded: false;
|
||||
|
||||
background: Theme.surface-main;
|
||||
|
||||
Flickable {
|
||||
@@ -288,13 +291,34 @@ export component ArtistPageView inherits Rectangle {
|
||||
}
|
||||
|
||||
// Biography — full content width, below the header block.
|
||||
// Read-more toggle expands an inline word-boundary truncation.
|
||||
if ArtistState.bio != "": Rectangle { height: 18px; }
|
||||
if ArtistState.bio != "": Text {
|
||||
text: ArtistState.bio;
|
||||
text: root.bio-expanded ? ArtistState.bio : ArtistState.bio-short;
|
||||
color: Theme.text-secondary;
|
||||
font-size: Typography.body;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
if ArtistState.bio-truncated: Rectangle {
|
||||
height: 24px;
|
||||
width: read-more-text.preferred-width + 16px;
|
||||
read-more-text := Text {
|
||||
text: root.bio-expanded ? @tr("Read less") : @tr("Read more");
|
||||
color: read-more-ta.has-hover
|
||||
? Theme.text-primary
|
||||
: Theme.accent;
|
||||
font-size: 13px;
|
||||
font-weight: Typography.medium;
|
||||
vertical-alignment: center;
|
||||
height: 100%;
|
||||
}
|
||||
read-more-ta := TouchArea {
|
||||
mouse-cursor: pointer;
|
||||
clicked => {
|
||||
root.bio-expanded = !root.bio-expanded;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle { height: 36px; }
|
||||
|
||||
|
||||
@@ -194,6 +194,10 @@ export global NavState {
|
||||
export global ArtistState {
|
||||
in property <string> name;
|
||||
in property <string> bio;
|
||||
// Truncated bio (word-boundary cut + ellipsis) for the at-rest view;
|
||||
// the full bio in `bio` is shown when the Read-more toggle expands.
|
||||
in property <string> bio-short;
|
||||
in property <bool> bio-truncated: false;
|
||||
in property <image> artwork;
|
||||
// Artwork-derived tint for the header gradient.
|
||||
in property <color> header-color: #181820;
|
||||
|
||||
Reference in new issue
Block a user