feat(slint): clickable artist name on AlbumCard -> artist page
Ports Tauri's behavior where clicking an album card's artist name
navigates to that artist (the card body still opens the album).
- AlbumCardItem gains artist-id; populated in every album-card
constructor (home/search/label/foryou/favorites). Artist-page
release cards leave it empty (their subtitle slot shows the year,
not the artist, so it stays non-clickable).
- AlbumCard wraps the artist name in a TouchArea that emits
media-action("artist", artist-id, "open") and brightens on hover
only when an id is known.
- main.rs handles ("artist","open") -> open the artist page;
FavoritesView (which only forwarded clicked) now forwards the
artist action.
cc
This commit is contained in:
8 files changed
+56
-6
No files matched your search
@@ -286,13 +286,26 @@ export component AlbumCard inherits Rectangle {
|
||||
vertical-alignment: center;
|
||||
overflow: elide;
|
||||
}
|
||||
Text {
|
||||
text: root.album.artist;
|
||||
// Artist name — clickable when an artist id is known,
|
||||
// navigating to the artist page (1:1 with Tauri).
|
||||
artist-area := TouchArea {
|
||||
height: 18px;
|
||||
color: Theme.text-muted;
|
||||
font-size: Typography.link;
|
||||
vertical-alignment: center;
|
||||
overflow: elide;
|
||||
width: artist-text.preferred-width;
|
||||
mouse-cursor: root.album.artist-id != "" ? pointer : default;
|
||||
clicked => {
|
||||
if (root.album.artist-id != "") {
|
||||
root.media-action("artist", root.album.artist-id, "open");
|
||||
}
|
||||
}
|
||||
artist-text := Text {
|
||||
text: root.album.artist;
|
||||
color: root.album.artist-id != "" && artist-area.has-hover
|
||||
? Theme.text-primary
|
||||
: Theme.text-muted;
|
||||
font-size: Typography.link;
|
||||
vertical-alignment: center;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user