fix(qbz-qt): forward the overlay button's click, and use it in AlbumCard

CardOverlayButton declared `signal clicked()` with no argument, but three
cards write `onClicked: function (mouse) { menu.openAtCursor(btn, mouse.x,
mouse.y) }` against it — so `mouse` was undefined and the context menus on
TrackCard, PlaylistCard and ArtistCard threw instead of opening. The signal
now carries the event; handlers that ignore it are unaffected.

AlbumCard drew its three hover discs as raw Rectangle + QbzIcon + MouseArea
blocks instead of the shared control every other card uses, which is how its
geometry drifted from theirs in the first place. It now mounts
CardOverlayButton with identical behaviour. One deliberate change rides along:
the favorited heart goes from the red `favorite` tint to the accent tint,
which is what discover/AlbumCard.slint actually specifies — the red was the
drift, not the parity.

cc
This commit is contained in:
vicrodh committed 2026-07-28 13:47:39 -06:00
1 parent 2875063626
commit 6e81b1ac78
2 files changed
+76 -75

No files matched your search

@@ -12,7 +12,11 @@ Rectangle {
property string name: ""
property bool primary: false
property bool active: false
signal clicked()
// Forwards the MouseArea event. Three cards write
// `onClicked: function (mouse) { menu.openAtCursor(btn, mouse.x, mouse.y) }`
// against this signal; while it took no argument, `mouse` was undefined and
// those context menus threw a TypeError instead of opening.
signal clicked(var mouse)
width: primary ? 44 : 36
height: primary ? 44 : 36
@@ -34,6 +38,6 @@ Rectangle {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: parent.clicked()
onClicked: function (m) { parent.clicked(m) }
}
}