diff options
Diffstat (limited to 'desktop/modules/sound')
| -rw-r--r-- | desktop/modules/sound/Osd.qml | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/desktop/modules/sound/Osd.qml b/desktop/modules/sound/Osd.qml index ede8cf1..8f7b477 100644 --- a/desktop/modules/sound/Osd.qml +++ b/desktop/modules/sound/Osd.qml @@ -101,11 +101,16 @@ Scope { readonly property string want: Player.active ? Player.artUrl : "" property int front: 0 + // The slot loading the wanted cover, -1 when none. Tracked by + // index because a url does not compare back to the string it + // was set from: QUrl decodes the %20s of the cache buster. + property int loading: -1 property bool artOn: false onWantChanged: { - if (want === "") { artOn = false; return; } - const back = front === 0 ? artB : artA; + if (want === "") { loading = -1; artOn = false; return; } + loading = front === 0 ? 1 : 0; + const back = loading === 0 ? artA : artB; // Cleared first so a URL the back image already holds // still loads and reports a status. back.source = ""; @@ -115,8 +120,8 @@ Scope { Component.onCompleted: wantChanged() function loaded(img, idx) { - if (img.source != want) return; - if (img.status === Image.Ready) { front = idx; artOn = true; } + if (idx !== loading) return; + if (img.status === Image.Ready) { front = idx; loading = -1; artOn = true; } else if (img.status === Image.Error) artOn = false; } |
