fix(cards): carry the Qobuz album version in card titles + tooltip when elided
Every album card producer copied `title` raw although the model carries
`version` ("50th Anniversary", "Deluxe"); the album page, info modal and quick
view already used `format_album_title`. The Artist page listed two identical
"All Things Must Pass" cards for two different editions.
- Route the 8 card producers through `album_qt::format_album_title`
(artist page buckets, album carousels, label grid, Home rails, Library ALL
feed, Artist Scene); search_qt drops its private duplicate of the helper.
- AlbumCard.qml: the title is always the full string, elided at the card
width; when Qt reports `truncated`, hovering shows the whole title in a
Controls ToolTip (QualityBadge pattern, no character counting, no ticker).
Verified: qmllint clean, qbz-qt suite 782/782, release build.
cc
This commit is contained in:
7 files changed
+55
-14
No files matched your search
@@ -921,6 +921,7 @@ Rectangle {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 2
|
||||
Text {
|
||||
id: titleText
|
||||
width: parent.width
|
||||
height: 20
|
||||
text: root.title
|
||||
@@ -930,6 +931,48 @@ Rectangle {
|
||||
font.weight: theme.weightMedium
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
// The title is ALWAYS the full one (version included) and
|
||||
// elides at the card's width; when it is cut, hovering shows
|
||||
// the whole text in a small bubble above the line. `truncated`
|
||||
// is Qt's own verdict on the elision, so a title that fits
|
||||
// never raises a tooltip — no character counting. Qt's own
|
||||
// ToolTip, like QualityBadge.qml: a recycled delegate deep
|
||||
// inside a view cannot name the shell's tooltip overlay.
|
||||
ToolTip {
|
||||
id: titleTip
|
||||
visible: titleArea.containsMouse && titleText.truncated
|
||||
&& root.title !== ""
|
||||
text: root.title
|
||||
delay: 350
|
||||
timeout: -1
|
||||
padding: 0
|
||||
x: 0
|
||||
y: -height - 4
|
||||
contentWidth: titleTipText.implicitWidth
|
||||
contentHeight: titleTipText.implicitHeight
|
||||
contentItem: Text {
|
||||
id: titleTipText
|
||||
text: titleTip.text
|
||||
color: theme.textPrimary
|
||||
font.pixelSize: 11
|
||||
font.weight: theme.weightMedium
|
||||
wrapMode: Text.Wrap
|
||||
width: Math.min(implicitWidth, 300)
|
||||
maximumLineCount: 3
|
||||
elide: Text.ElideRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
leftPadding: 9
|
||||
rightPadding: 9
|
||||
topPadding: 5
|
||||
bottomPadding: 5
|
||||
}
|
||||
background: Rectangle {
|
||||
color: theme.surfaceElevated
|
||||
radius: theme.radiusSm
|
||||
border.width: 1
|
||||
border.color: theme.borderSubtle
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
id: titleArea
|
||||
anchors.fill: parent
|
||||
|
||||
Reference in new issue
Block a user