feat(slint): keyboard multi-select on the built-out surfaces (Mix, Label, LocalLibrary Albums)
Extend the keyboard multi-select feature to the surfaces that had no working selection in the Slint port. - Mix (DailyQ/WeeklyQ/FavQ/TopQ all render through one MixView): mode toggle + MultiSelectBar, per-row checkbox via the central toggle arm + a ContentView::Mix branch (model + recount), bulk play-next/queue/ add-to-playlist. Shift-range, Ctrl+A and Escape inherited automatically. - Label Popular Tracks: was a dead stub (checkboxes with no bar/recount/ router arms). Converted the local mode flag to LabelState.multi-select, added a real MultiSelectBar + label.rs recount/select_all/clear/selected, and the missing select-toggle/bulk router arms. - LocalLibrary Albums grid (a previously-missing surface): AlbumCardItem gains a `selected` field; a `select-mode` prop is threaded through the shared AlbumCard / AlbumListRow / AlbumGrid / AlbumCollectionView (default false, so Discover/Label/Favorites are untouched). Albums toolbar toggle + MultiSelectBar; local_library.rs album select fns (flat + grouped, id-resilient Shift-range over AlbumCardItem); album->tracks bulk resolve via fetch_album_tracks_blocking on spawn_blocking for queue/play-next/ add-to-playlist/add-to-mixtape; Ctrl+A and Escape routed by active-tab. cargo check -p qbz green (qbz_ui compiles clean). cc
This commit is contained in:
13 files changed
+783
-58
No files matched your search
@@ -77,6 +77,10 @@ export component AlbumCard inherits Rectangle {
|
||||
// Always-visible source badge on the artwork (Local Library: local |
|
||||
// qobuz-offline | plex). Off elsewhere (single-source catalogs).
|
||||
in property <bool> show-source-badge: false;
|
||||
// Multi-select mode (Local Library albums): a checkbox overlay replaces the
|
||||
// hover action buttons, and the card click toggles selection instead of
|
||||
// opening. Default false → every other AlbumCard consumer is untouched.
|
||||
in property <bool> select-mode: false;
|
||||
// Fade out when the card is being removed (favorites un-favorite).
|
||||
opacity: root.album.removing ? 0.0 : 1.0;
|
||||
animate opacity { duration: 250ms; }
|
||||
@@ -161,12 +165,41 @@ export component AlbumCard inherits Rectangle {
|
||||
height: 100%;
|
||||
mouse-cursor: pointer;
|
||||
clicked => {
|
||||
root.clicked(root.album.id);
|
||||
if (root.select-mode) {
|
||||
root.media-action("album", root.album.id, "toggle-select");
|
||||
} else {
|
||||
root.clicked(root.album.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Hover action buttons — favorite / play / more.
|
||||
// Multi-select checkbox — top-right of the art, shown only in
|
||||
// select-mode (the card click toggles; this is the indicator).
|
||||
if root.select-mode: Rectangle {
|
||||
x: parent.width - self.width - 8px;
|
||||
y: 8px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 12px;
|
||||
background: root.album.selected ? Theme.accent : #00000099;
|
||||
border-width: 1.5px;
|
||||
border-color: root.album.selected ? Theme.accent : #ffffffcc;
|
||||
animate background { duration: 120ms; }
|
||||
QbzIcon {
|
||||
source: @image-url("../assets/icons/check.svg");
|
||||
visible: root.album.selected;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
x: Math.round((parent.width - self.width) / 2 / 1px) * 1px;
|
||||
y: Math.round((parent.height - self.height) / 2 / 1px) * 1px;
|
||||
tint: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
// Hover action buttons — favorite / play / more. Hidden in
|
||||
// select-mode (the click toggles selection instead).
|
||||
HorizontalLayout {
|
||||
visible: !root.select-mode;
|
||||
x: 0px;
|
||||
y: 120px;
|
||||
width: 200px;
|
||||
|
||||
@@ -20,6 +20,7 @@ component AlbumGrid inherits Rectangle {
|
||||
in property <length> card-gap: 24px;
|
||||
in property <bool> show-favorite: true;
|
||||
in property <bool> show-source-badge: false;
|
||||
in property <bool> select-mode: false;
|
||||
callback open-album(string);
|
||||
callback open-artist(string);
|
||||
callback media-action(string, string, string);
|
||||
@@ -40,6 +41,7 @@ component AlbumGrid inherits Rectangle {
|
||||
album: album;
|
||||
show-favorite: root.show-favorite;
|
||||
show-source-badge: root.show-source-badge;
|
||||
select-mode: root.select-mode;
|
||||
clicked(id) => {
|
||||
root.open-album(id);
|
||||
}
|
||||
@@ -65,6 +67,9 @@ export component AlbumCollectionView inherits VerticalLayout {
|
||||
// Forwarded to AlbumCard — show the always-visible source badge on the
|
||||
// grid card art (Local Library: local | qobuz-offline | plex).
|
||||
in property <bool> show-source-badge: false;
|
||||
// Forwarded to AlbumCard / AlbumListRow — checkbox + toggle-on-click
|
||||
// (Local Library albums multi-select). Default false everywhere else.
|
||||
in property <bool> select-mode: false;
|
||||
in property <length> card-width: 200px;
|
||||
in property <length> card-height: 246px;
|
||||
in property <length> card-gap: 24px;
|
||||
@@ -98,6 +103,7 @@ export component AlbumCollectionView inherits VerticalLayout {
|
||||
album: album;
|
||||
index: i;
|
||||
show-source: root.show-source;
|
||||
select-mode: root.select-mode;
|
||||
clicked(id) => {
|
||||
root.open-album(id);
|
||||
}
|
||||
@@ -115,6 +121,7 @@ export component AlbumCollectionView inherits VerticalLayout {
|
||||
albums: section.albums;
|
||||
show-favorite: root.show-favorite;
|
||||
show-source-badge: root.show-source-badge;
|
||||
select-mode: root.select-mode;
|
||||
card-width: root.card-width;
|
||||
card-height: root.card-height;
|
||||
card-gap: root.card-gap;
|
||||
@@ -136,6 +143,7 @@ export component AlbumCollectionView inherits VerticalLayout {
|
||||
albums: root.albums;
|
||||
show-favorite: root.show-favorite;
|
||||
show-source-badge: root.show-source-badge;
|
||||
select-mode: root.select-mode;
|
||||
card-width: root.card-width;
|
||||
card-height: root.card-height;
|
||||
card-gap: root.card-gap;
|
||||
@@ -160,6 +168,7 @@ export component AlbumCollectionView inherits VerticalLayout {
|
||||
album: album;
|
||||
index: i;
|
||||
show-source: root.show-source;
|
||||
select-mode: root.select-mode;
|
||||
clicked(id) => {
|
||||
root.open-album(id);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user