fix(slint): favorite state on album cards + un-favorite in place
AlbumCardItem gains is-favorite (filled accent heart on the card + "Remove from favorites" in the list-row menu) — favorites albums set it true so the heart shows its state, which it never did before. Un-favoriting from the favorites list (track heart or album card heart) now removes the item: the row/card fades out (new `removing` field drives a 250ms opacity animation on TrackRow / AlbumCard / AlbumListRow), the favorite is removed on the server (+ fav_cache for tracks), and the row is dropped from both the full and visible models after the fade. All TrackItem / AlbumCardItem initializers carry the new fields. cc
This commit is contained in:
14 files changed
+178
-6
No files matched your search
@@ -465,6 +465,9 @@ export component FavoritesView inherits Rectangle {
|
||||
FavoritesActions.open-album(id);
|
||||
} else if (kind == "artist" && action == "open") {
|
||||
FavoritesActions.open-artist(id);
|
||||
} else if (action == "favorite") {
|
||||
// In the favorites list, un-favorite + fade out.
|
||||
FavoritesActions.unfavorite-track(id);
|
||||
} else {
|
||||
FavoritesActions.track-action(id, action);
|
||||
}
|
||||
@@ -578,7 +581,12 @@ export component FavoritesView inherits Rectangle {
|
||||
root.open-artist(id);
|
||||
}
|
||||
media-action(kind, id, action) => {
|
||||
FavoritesActions.album-action(id, action);
|
||||
if (action == "favorite") {
|
||||
// In the favorites list, un-favorite + fade out.
|
||||
FavoritesActions.unfavorite-album(id);
|
||||
} else {
|
||||
FavoritesActions.album-action(id, action);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user