fix(qt): fade on tab switches, playlist recents artwork, per-rail sizes, wheel
Four defects from the smoke of 26ceeab82.
TAB SWITCHES DID NOT FADE. The page fade hangs off the router's Loader
`source`, and a tab switch inside a view never touches it — so Discover's four
tabs, Library's and Local Library's cut hard while a route change faded, which
is the same event from where the user sits. `activeTab` is the one name every
tabbed view uses for this (the nav-flyout Binding already routes through it),
so one Connections in the router covers all of them; `ignoreUnknownSignals`
leaves the untabbed views alone. No watchdog and no opacity assignment there: a
tab body is built synchronously in the same turn, so `restart()` alone — which
sets the page to `from` — is the whole transition. The `running` guard keeps a
tab stamped right after a route change from restarting that route's fade.
RECENTLY PLAYED PLAYLISTS DREW PLACEHOLDERS. The rail published only
`artwork_url`, taken from the detail page's `cover_url` — and that field is
empty for every playlist WITHOUT a graphic of its own, which is most of them
and is exactly why the detail page falls back to a collage. A local playlist has
no Qobuz graphic at all, so it could never resolve one. The meta store now keeps
the member covers and an own-image flag beside the url, and the card gets both
arms it already knows how to draw: contain-fitted single graphic, or the mosaic.
All of it rides `art_url` and lets `attach_cached` fill the path —
`artwork_qt::cached_path` already classifies http, Plex and on-disk paths, so a
custom cover and a local file resolve through the same pass as a Qobuz url.
ITEMS PER CAROUSEL WAS ONE NUMBER FOR THE WHOLE PAGE. Tauri's was per rail
(`HomeSettingsModal.svelte`), and the global was a simplification that lost the
point of the feature: a 25-wide "New Releases" beside a 10-wide "Recently
Played" is why anyone opens it. Storage is now a row per section — absent means
the default, and setting a rail back to the default DELETES its row, so the
file only carries what was actually changed. The select moves into each row of
the configurator, and the cut moves into `order_by_prefs`, keyed by the PREF id:
`mostStreamed` resolves to a per-tab variant candidate, so the section's own id
is not always the id the user configured, and that loop is the only place both
are in hand.
OPEN OVERLAYS LET THE WHEEL THROUGH. A MouseArea consumes presses and NOT wheel
events, so with the configurator open the pointer still scrolled the page
underneath — over the panel it moved the panel's own list and the page behind it
at once. These overlays are plain Items rather than Popups, so nothing grabs for
them and each has to stop the wheel at its own surface: the configurator, the
genre popup, the playlist-category popup and the Local Library funnel.
Release build clean, offscreen smoke green, 421/421 and 215/215.
cc
This commit is contained in:
13 files changed
+291
-185
No files matched your search
@@ -91,6 +91,14 @@ Item {
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: root.close()
|
||||
// Eat the WHEEL as well as the click. A MouseArea consumes presses
|
||||
// but lets wheel events fall straight through, so with this open
|
||||
// the pointer still scrolled the page underneath — and over the
|
||||
// panel it moved the panel's own list AND the page behind it at the
|
||||
// same time. These overlays are plain Items, not Popups, so there
|
||||
// is no modal grab doing it for them: each has to stop the wheel at
|
||||
// its own surface.
|
||||
onWheel: function (wheel) { wheel.accepted = true }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,8 +114,13 @@ Item {
|
||||
border.color: theme.borderSubtle
|
||||
clip: true
|
||||
|
||||
// Swallow clicks so they never reach the scrim.
|
||||
MouseArea { anchors.fill: parent }
|
||||
// Swallow clicks so they never reach the scrim — and the wheel, so a
|
||||
// scroll that starts outside the section list (the title, the banner,
|
||||
// the footer) does not reach the page behind the modal.
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onWheel: function (wheel) { wheel.accepted = true }
|
||||
}
|
||||
|
||||
Column {
|
||||
// NOT `body`: WarningBanner below has a `body` PROPERTY, and an
|
||||
@@ -176,68 +189,19 @@ Item {
|
||||
font.weight: theme.weightMedium
|
||||
}
|
||||
|
||||
// --- Items per carousel ---------------------------------------
|
||||
// Recovered from Tauri (`HomeSettingsModal.svelte`), which let the
|
||||
// user cap how many items each carousel showed. It never reached
|
||||
// Slint — the discovery-v2 modal Slint was ported from only ever
|
||||
// modelled {id, enabled} — so Qt inherited the absence.
|
||||
//
|
||||
// GLOBAL, so it reads its own bridge property rather than the
|
||||
// per-tab document: `root.mine` gates the rows below on the tab
|
||||
// payload having landed, and this control must be usable before
|
||||
// that.
|
||||
Item {
|
||||
visible: root.tab !== "recommendations"
|
||||
width: parent.width
|
||||
height: 34
|
||||
|
||||
Text {
|
||||
id: sizeLabel
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: QbzSession.tr("Items per carousel", QbzSession.trRev)
|
||||
color: theme.textMuted
|
||||
font.pixelSize: theme.fontBody
|
||||
}
|
||||
QbzSelect {
|
||||
anchors.left: sizeLabel.right
|
||||
anchors.leftMargin: 8
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
sm: true
|
||||
menuWidth: 140
|
||||
// Option ORDER is the contract with RAIL_SIZE_PRESETS in
|
||||
// qbz-app/src/settings/discover_prefs.rs — the bridge
|
||||
// publishes an index, not a count, so reordering these
|
||||
// silently changes what every stored value means. "All" is
|
||||
// the stored 0 and the default: it is what this page did
|
||||
// before the setting existed.
|
||||
options: [
|
||||
"10",
|
||||
"15",
|
||||
"20",
|
||||
"25",
|
||||
QbzSession.tr("All", QbzSession.trRev),
|
||||
]
|
||||
currentIndex: QbzHome.discoverRailSizeIndex
|
||||
onSelected: function (i) { QbzHome.discoverSetRailSize(i) }
|
||||
}
|
||||
}
|
||||
|
||||
// --- Section list ---------------------------------------------
|
||||
// Explicit, content-derived height capped to what is left of the
|
||||
// panel; the Flickable scrolls past that.
|
||||
//
|
||||
// The subtrahend is the FIXED-CHROME BUDGET (title + banner + count
|
||||
// + the size row + footer + margins), and it is load-bearing: the
|
||||
// panel clips (`clip: true` above), so a row added over this list
|
||||
// without raising the number does not overflow visibly — the last
|
||||
// sections and the Reset footer simply stop existing. It went
|
||||
// 260 -> 308 with the size row: 34 of row plus the column's 14 of
|
||||
// spacing.
|
||||
// + footer + margins), and it is load-bearing: the panel clips
|
||||
// (`clip: true` above), so a row added over this list without
|
||||
// raising the number does not overflow visibly — the last sections
|
||||
// and the Reset footer simply stop existing.
|
||||
Item {
|
||||
visible: root.tab !== "recommendations"
|
||||
width: parent.width
|
||||
height: Math.max(0, Math.min(listCol.height, root.height * 0.78 - 308))
|
||||
height: Math.max(0, Math.min(listCol.height, root.height * 0.78 - 260))
|
||||
clip: true
|
||||
Flickable {
|
||||
id: listFlick
|
||||
@@ -284,7 +248,7 @@ Item {
|
||||
onToggled: QbzBridge.discoverToggleSection(root.tab, cfgRow.modelData.id)
|
||||
}
|
||||
Text {
|
||||
width: parent.width - 18 - 28 - 28 - 3 * 12
|
||||
width: parent.width - 18 - 82 - 28 - 28 - 4 * 12
|
||||
height: parent.height
|
||||
text: cfgRow.modelData.label
|
||||
color: cfgRow.modelData.enabled ? theme.textPrimary : theme.textMuted
|
||||
@@ -293,6 +257,41 @@ Item {
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
// How many items THIS rail shows. Per rail
|
||||
// and not one number for the page: that is
|
||||
// the shape Tauri had
|
||||
// (`HomeSettingsModal.svelte`), and it is
|
||||
// the point of the feature — a 25-wide
|
||||
// "New Releases" next to a 10-wide
|
||||
// "Recently Played" is why anyone opens
|
||||
// this.
|
||||
//
|
||||
// Option ORDER is the contract with
|
||||
// RAIL_SIZE_PRESETS in
|
||||
// qbz-app/src/settings/discover_prefs.rs:
|
||||
// the bridge carries an index, not a count,
|
||||
// so reordering these silently changes what
|
||||
// every stored value means. "All" is the
|
||||
// stored 0 and the default — what this page
|
||||
// did before the setting existed.
|
||||
QbzSelect {
|
||||
width: 82
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
sm: true
|
||||
menuWidth: 110
|
||||
enabled: cfgRow.modelData.enabled
|
||||
options: [
|
||||
"10",
|
||||
"15",
|
||||
"20",
|
||||
"25",
|
||||
QbzSession.tr("All", QbzSession.trRev),
|
||||
]
|
||||
currentIndex: cfgRow.modelData.sizeIndex || 0
|
||||
onSelected: function (i) {
|
||||
QbzHome.discoverSetRailSize(root.tab, cfgRow.modelData.id, i)
|
||||
}
|
||||
}
|
||||
ReorderButton {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
glyph: "chevron-up"
|
||||
|
||||
@@ -97,6 +97,10 @@ Item {
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: root.close()
|
||||
// Same wheel rule as the configurator modal: a MouseArea eats the
|
||||
// press and not the wheel, so without this the page kept scrolling
|
||||
// under an open popup.
|
||||
onWheel: function (wheel) { wheel.accepted = true }
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
@@ -112,7 +116,10 @@ Item {
|
||||
|
||||
// Swallow clicks that land on the card's own chrome so the backdrop
|
||||
// does not close it. Declared FIRST: the content below stays on top.
|
||||
MouseArea { anchors.fill: parent }
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onWheel: function (wheel) { wheel.accepted = true }
|
||||
}
|
||||
|
||||
Column {
|
||||
id: col
|
||||
|
||||
@@ -80,6 +80,9 @@ Item {
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: root.close()
|
||||
// A MouseArea eats presses, NOT wheel events. Without this the page
|
||||
// behind an open popup kept scrolling under the pointer.
|
||||
onWheel: function (wheel) { wheel.accepted = true }
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
@@ -93,8 +96,12 @@ Item {
|
||||
border.color: theme.borderMuted
|
||||
clip: true
|
||||
|
||||
// Swallow clicks so the backdrop does not close the card.
|
||||
MouseArea { anchors.fill: parent }
|
||||
// Swallow clicks so the backdrop does not close the card, and the
|
||||
// wheel so a scroll over the footer does not reach the page.
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onWheel: function (wheel) { wheel.accepted = true }
|
||||
}
|
||||
|
||||
Flickable {
|
||||
id: listFlick
|
||||
|
||||
Reference in new issue
Block a user