feat(qbz-qt): Track Info in the now-playing bars, and PlayerBar split up
The info button on both bars did nothing. The modal is ported from Slint, and the document behind it — title, album, artist, duration, quality, ISRC, label, copyright and the grouped credits — comes from a new track_info_qt module. Credit parsing and its role localization were already frontend-agnostic in qbz-qobuz, so this only fetches and shapes; it does not re-implement them. A local or Plex id is rejected before the request rather than sent to the Qobuz catalog API, which is how a local album path ended up as a 404 in the owner's log. PlayerBar was 708 lines and still carried an inline SongCard, transport cluster and favourite toggle; those are their own files now, so the bar leaves this change smaller than it arrived. The volume controls in both bars are wired to the lock from the previous commit. cc
This commit is contained in:
13 files changed
+1182
-344
No files matched your search
@@ -0,0 +1,43 @@
|
||||
// FavToggle — the inline favorite heart the Classic bar mounts next to "+"
|
||||
// (Tauri's `.control-btn` heart with fill=currentColor when favorited),
|
||||
// extracted verbatim from PlayerBar.qml (phase 25 size split).
|
||||
//
|
||||
// NOT a QbzIconButton: that control only tints accent/primary/secondary/muted
|
||||
// and the favorited heart must take the theme's `favorite` red (Slint
|
||||
// TransportControls uses Theme.favorite the same way).
|
||||
|
||||
import QtQuick
|
||||
import com.blitzfc.qbz
|
||||
import "../theme"
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
/// Favorite state of the now-playing track (QueueState.now-playing-favorite
|
||||
/// in Slint) — the host bar already parses the queue document.
|
||||
property bool favorite: false
|
||||
|
||||
QbzTheme { id: theme }
|
||||
|
||||
width: 32
|
||||
height: 32
|
||||
radius: theme.radiusSm
|
||||
opacity: QbzPlayer.npHasTrack ? 1.0 : 0.3
|
||||
color: (favArea.containsMouse && QbzPlayer.npHasTrack) ? theme.surfaceHover : "transparent"
|
||||
|
||||
QbzIcon {
|
||||
name: root.favorite ? "heart-filled" : "heart"
|
||||
width: 16
|
||||
height: 16
|
||||
anchors.centerIn: parent
|
||||
tintName: root.favorite ? "favorite"
|
||||
: (favArea.containsMouse ? "primary" : "secondary")
|
||||
}
|
||||
MouseArea {
|
||||
id: favArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: QbzPlayer.npHasTrack ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
onClicked: if (QbzPlayer.npHasTrack && QbzPlayer.npTrackId !== "")
|
||||
QbzQueue.queueToggleFavorite("track", QbzPlayer.npTrackId)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user