fix(qt): the local album page gets its zebra, across the whole row
The shared TrackRow has had a `zebra` flag all along, off by default, and the Qobuz album page turns it on. The local one never did — and turning it on at the call site would not have been enough either, because LocalTrackRow wraps the shared row without forwarding the flag. Forwarding it is still not the fix. TrackRow tints its own background rectangle, which is `parent.width` wide, and this wrapper hands the shared row `root.width - 26 - 46`: a 26px gutter for the source glyph and 46px for the context menu the wrapper draws itself. A stripe painted from in there stops 72px short and leaves both controls outside it — which is what the smoke caught. The stripe is therefore painted by the wrapper, full width, declared before the shared row so it lands underneath and takes no pointer events. Same colour literal and same parity rule as rows/TrackRow.qml, so a local list and a Qobuz list stripe identically. cc
This commit is contained in:
2 files changed
+24
No files matched your search
@@ -660,6 +660,10 @@ Rectangle {
|
||||
onLoaded: root._rowsBuilt++ // INSTRUM.
|
||||
sourceComponent: LocalTrackRow {
|
||||
width: page.width
|
||||
// Same as the Qobuz album page
|
||||
// (AlbumView.qml) — the two track lists
|
||||
// should not disagree about this.
|
||||
zebra: true
|
||||
item: trackBlock.modelData
|
||||
number: trackBlock.modelData.number > 0
|
||||
? trackBlock.modelData.number : trackBlock.index + 1
|
||||
|
||||
@@ -64,6 +64,11 @@ Item {
|
||||
property var view: null
|
||||
property bool selectMode: false
|
||||
property bool checked: false
|
||||
/// Alternating row tint, forwarded to the shared row. Off by default there
|
||||
/// (rows/TrackRow.qml), which is why the local album page had none while
|
||||
/// the Qobuz one (AlbumView.qml) did — the flag was simply never handed
|
||||
/// through this wrapper.
|
||||
property bool zebra: false
|
||||
signal playRequested()
|
||||
signal enqueueRequested(string mode)
|
||||
signal toggleSelect()
|
||||
@@ -85,6 +90,21 @@ Item {
|
||||
readonly property bool canGoAlbum: (item.albumId || "") !== ""
|
||||
readonly property bool canGoArtist: (item.artist || "") !== ""
|
||||
|
||||
// Zebra is painted HERE, not forwarded to the shared row. TrackRow tints
|
||||
// its own background rectangle, which is `parent.width` wide — and this
|
||||
// wrapper hands it `root.width - 26 - 46`, holding back a 26px gutter for
|
||||
// the source glyph and 46px for the context menu it draws itself. Tinting
|
||||
// from in there therefore stopped 72px short and left those two controls
|
||||
// sitting outside the stripe. Declared before the shared row so it paints
|
||||
// underneath, and with no pointer area of its own.
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: 8
|
||||
// Same literal and same parity rule as rows/TrackRow.qml, so a local
|
||||
// list and a Qobuz list stripe identically.
|
||||
color: (root.zebra && root.number % 2 === 0) ? "#07ffffff" : "transparent"
|
||||
}
|
||||
|
||||
TrackRow {
|
||||
id: sharedRow
|
||||
// 26px source-glyph gutter + the 46px (32 cell + 14 gap) the shared
|
||||
|
||||
Reference in new issue
Block a user