feat(slint): play-from-clicked-track, track-row quality badge, album link, playlist layout
Committed together because these changes share main.rs, playlist.rs and
PlaylistView.slint, and the new quality field is atomic across every
TrackItem builder, so they cannot compile as separate whole-file commits.
- Universal play-from-here: a single play_track_in_context dispatcher builds
the queue from the current view's VISIBLE list and starts at the clicked
track (playlist, album, artist, favorites, label, mix, search). Cached
views order by the visible model; re-fetch views (album / artist top
tracks) reorder to the in-page filter; the search "most popular" hero
prepends to the results queue. Drops the playlist-track / mix-track arms
that always started at track 1 (the clicked id was read from the wrong
media-action slot).
- Album-name links in track rows open the album page (the ("album","open")
media-action arm was missing and fell through to a no-op).
- Unified track-row quality badge: a new quality-detail field on TrackItem,
populated from bit-depth / sample-rate in every builder through a shared
crate::quality::detail, rendered with a bare (no chip background/border,
centered text) QualityBadgeFull. Restores the exact bit-depth / sample-rate
line that had regressed to a plain CD / Hi-Res tier.
- Playlist track list: reserve the favorite / download / context-menu columns
in the column header, match the row's 36px cover cell, and anchor the
scrollbar to the view edge (matches Local Library > Tracks).
cc
This commit is contained in:
17 files changed
+603
-187
No files matched your search
@@ -22,6 +22,7 @@ import { TrackItem, DragActions, NowPlayingState, NavState } from "../state.slin
|
||||
import { QbzIcon } from "QbzIcon.slint";
|
||||
import { TrackPlayCell } from "TrackPlayCell.slint";
|
||||
import { TrackContextMenu } from "TrackContextMenu.slint";
|
||||
import { QualityBadgeFull } from "QualityBadgeFull.slint";
|
||||
|
||||
export component TrackRow inherits Rectangle {
|
||||
in property <TrackItem> track;
|
||||
@@ -382,16 +383,20 @@ export component TrackRow inherits Rectangle {
|
||||
horizontal-alignment: center;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
// Quality.
|
||||
Text {
|
||||
text: root.track.quality-tier == "hires"
|
||||
? "Hi-Res"
|
||||
: (root.track.quality-tier == "cd" ? "CD" : "");
|
||||
width: 70px;
|
||||
color: Theme.text-muted;
|
||||
font-size: Typography.legal;
|
||||
horizontal-alignment: center;
|
||||
vertical-alignment: center;
|
||||
// Quality — bare badge (tier label + exact bit-depth / sample-rate),
|
||||
// no chip background so it blends into the row.
|
||||
HorizontalLayout {
|
||||
width: 92px;
|
||||
alignment: center;
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
QualityBadgeFull {
|
||||
tier: root.track.quality-tier;
|
||||
detail: root.track.quality-detail;
|
||||
show-icon: false;
|
||||
bare: true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Favorite — filled accent heart when favorited, outline heart
|
||||
|
||||
Reference in new issue
Block a user