mpris album art: keep last good source, clear on track change
This commit is contained in:
parent
2be333d3f0
commit
3ed00dd905
1 changed files with 8 additions and 2 deletions
|
|
@ -28,11 +28,17 @@ M.PopupPanel {
|
|||
Image {
|
||||
id: _artImg
|
||||
anchors.fill: parent
|
||||
source: menuWindow.player?.trackArtUrl ?? ""
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
visible: status === Image.Ready
|
||||
asynchronous: true
|
||||
cache: false
|
||||
|
||||
property string _lastGoodSource: ""
|
||||
property string _lastTrack: ""
|
||||
readonly property string _artUrl: menuWindow.player?.trackArtUrl ?? ""
|
||||
readonly property string _track: menuWindow.player?.trackTitle ?? ""
|
||||
on_ArtUrlChanged: if (_artUrl) _lastGoodSource = _artUrl
|
||||
on_TrackChanged: if (_track !== _lastTrack) { _lastTrack = _track; _lastGoodSource = _artUrl || "" }
|
||||
source: _lastGoodSource
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue