fix(qt): search top-result track hero no longer invades the Artists rail + crown icon

Two Most-popular regressions on the search results page:

- When the top result is a TRACK, the hero painted from its slot's center
  ~100px into the Artists carousel: SearchTrackHero's root Rectangle had
  no size, and a bare Item's implicit size is 0x0 (it does not size from
  children), so the slot's horizontalCenter anchor pushed the whole card
  sideways. The artist/album arms carry explicit sizes and never shifted.
  The hero now declares its 200px width explicitly.
- The header glyph was "award", which reads as a mic. The reference uses
  the crown (SearchResultsView.slint:584); crown.svg is ported into the
  icon masters (primary + the warning bake) and the header uses it.

Both verified live on a VNC-driven session with the exact "all things"
search from the report.

km
This commit is contained in:
vicrodh committed 2026-08-10 22:08:43 -06:00
1 parent 1fe20e9af0
commit af95ce164a
4 files changed
+15 -1

No files matched your search

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z"/><path d="M5 21h14"/></svg>

After

Width:  |  Height:  |  Size: 431 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#fbbf24" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z"/><path d="M5 21h14"/></svg>

After

Width:  |  Height:  |  Size: 431 B

+12 -1
View File
@@ -247,9 +247,17 @@ Rectangle {
property var card: ({}) property var card: ({})
property string qualityLabel: "" property string qualityLabel: ""
color: "transparent" color: "transparent"
// EXPLICIT size, and load-bearing: a bare Rectangle's implicit size
// is 0x0 (Item does NOT size from children), and the hero slot centers
// it — so the whole card painted from the slot's CENTER, ~100px into
// the Artists carousel, whenever the top result was a track (the
// artist/album arms carry their own 200px and never shifted).
width: 200
height: heroCol.implicitHeight
readonly property bool overlayOn: heroArtArea.containsMouse readonly property bool overlayOn: heroArtArea.containsMouse
Column { Column {
id: heroCol
spacing: 0 spacing: 0
Rectangle { Rectangle {
width: 200 width: 200
@@ -508,7 +516,10 @@ Rectangle {
spacing: 12 spacing: 12
Row { Row {
spacing: 8 spacing: 8
QbzIcon { name: "award"; width: 18; height: 18; tintName: "warning" } // The crown, 1:1 with the reference
// (SearchResultsView.slint:584) — the POC's
// "award" read as a mic.
QbzIcon { name: "crown"; width: 18; height: 18; tintName: "warning" }
Text { Text {
text: QbzSession.tr("Most popular", QbzSession.trRev) text: QbzSession.tr("Most popular", QbzSession.trRev)
color: theme.textPrimary color: theme.textPrimary
+1
View File
@@ -184,6 +184,7 @@ const MASTERS: &[(&str, &str)] = &[
("disc", include_str!("../qml/assets/icons/primary/disc.svg")), ("disc", include_str!("../qml/assets/icons/primary/disc.svg")),
("element-connect", include_str!("../qml/assets/icons/primary/element-connect.svg")), ("element-connect", include_str!("../qml/assets/icons/primary/element-connect.svg")),
("ellipsis", include_str!("../qml/assets/icons/primary/ellipsis.svg")), ("ellipsis", include_str!("../qml/assets/icons/primary/ellipsis.svg")),
("crown", include_str!("../qml/assets/icons/primary/crown.svg")),
("external-link", include_str!("../qml/assets/icons/primary/external-link.svg")), ("external-link", include_str!("../qml/assets/icons/primary/external-link.svg")),
("eye-off", include_str!("../qml/assets/icons/primary/eye-off.svg")), ("eye-off", include_str!("../qml/assets/icons/primary/eye-off.svg")),
("eye", include_str!("../qml/assets/icons/primary/eye.svg")), ("eye", include_str!("../qml/assets/icons/primary/eye.svg")),