fix(ui): cap now playing cards at eighty percent

Apply one shared runway fraction to the SongCard in New, Classic, Large, and Small modes while preserving each mode's alignment.

cx
This commit is contained in:
vicrodh committed 2026-08-23 20:36:52 -06:00
1 parent 63ca21abaf
commit 390a800545
3 files changed
+14 -8

No files matched your search

@@ -312,15 +312,16 @@ Rectangle {
// shell's ArtPreviewOverlay was simply never armed in // shell's ArtPreviewOverlay was simply never armed in
// Small). Rule 5 — reuse, don't fork. // Small). Rule 5 — reuse, don't fork.
// //
// Width = the column minus the Sep + time column, so the // The live runway is the column minus Sep + time; the
// title and the meta budget elide at exactly the free // shared 80% cap keeps this mode consistent with the three
// space. Height = the 39px controls row: BOTH must be // full bars. Height = the 39px controls row: BOTH must be
// explicit, because SongCard's own defaults are 200x74 and // explicit, because SongCard's own defaults are 200x74 and
// a 74px card would push the 37px cover off-centre. // a 74px card would push the 37px cover off-centre.
SongCard { SongCard {
height: parent.height height: parent.height
width: Math.max(0, readonly property real availableWidth: Math.max(0,
parent.width - (QbzPlayer.npHasTrack ? 59 : 0)) parent.width - (QbzPlayer.npHasTrack ? 59 : 0))
width: availableWidth * theme.npbSongCardMaxFraction
artSize: 37 artSize: 37
artBorderWidth: 3 artBorderWidth: 3
artBorderColor: theme.surfaceCard artBorderColor: theme.surfaceCard
+5 -4
View File
@@ -426,8 +426,9 @@ Rectangle {
SongCard { SongCard {
visible: !root.isClassic visible: !root.isClassic
x: root.largeActive ? root.dockWidth + 8 : 0 x: root.largeActive ? root.dockWidth + 8 : 0
width: Math.max(0, readonly property real availableWidth: Math.max(0,
controlsLayout.transportLeft - 10 - leftZone.x - x) controlsLayout.transportLeft - 10 - leftZone.x - x)
width: availableWidth * theme.npbSongCardMaxFraction
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
showArt: !root.largeActive showArt: !root.largeActive
showBadges: !root.largeActive showBadges: !root.largeActive
@@ -653,8 +654,8 @@ Rectangle {
} }
// Classic lives between the REAL left transport and right action // Classic lives between the REAL left transport and right action
// cluster. It may use at most 85% of that live gap, centred: the // cluster. It may use at most 80% of that live gap, centred: the
// remaining 7.5% on each side keeps both the cover edge and the // remaining 10% on each side keeps both the cover edge and the
// in-card AudioStamp visibly detached from their neighbour controls. // in-card AudioStamp visibly detached from their neighbour controls.
// Unlike the old fixed 560px cap this still scales with volume // Unlike the old fixed 560px cap this still scales with volume
// steppers, remote state and the actual window width. // steppers, remote state and the actual window width.
@@ -664,7 +665,7 @@ Rectangle {
readonly property real availableWidth: Math.max(0, readonly property real availableWidth: Math.max(0,
controlsLayout.rightControlsLeft controlsLayout.rightControlsLeft
- controlsLayout.classicTransportRight) - controlsLayout.classicTransportRight)
width: availableWidth * 0.85 width: availableWidth * theme.npbSongCardMaxFraction
x: controlsLayout.classicTransportRight x: controlsLayout.classicTransportRight
+ (availableWidth - width) / 2 + (availableWidth - width) / 2
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
+4
View File
@@ -422,6 +422,10 @@ QtObject {
// window width entirely, so folding it in would misrepresent the rule. // window width entirely, so folding it in would misrepresent the rule.
readonly property int npbBreakMid: 1366 readonly property int npbBreakMid: 1366
readonly property int npbBreakWide: 1920 readonly property int npbBreakWide: 1920
// Owner visual ruling (2026-08-23): the metadata card may consume at most
// 80% of its live runway in every NPB mode. One token keeps New, Classic,
// Large and Small from drifting back to four different proportions.
readonly property real npbSongCardMaxFraction: 0.80
// `w` is the BAR's width, which is the window's width: both bars are // `w` is the BAR's width, which is the window's width: both bars are
// anchored left-to-right on the shell root (AppShell.qml:72-80), NOT // anchored left-to-right on the shell root (AppShell.qml:72-80), NOT
// inset by the sidebar or the queue column (those anchor to npb.top). // inset by the sidebar or the queue column (those anchor to npb.top).