Commit 92b5ca8c authored by Fushan Wen's avatar Fushan Wen
Browse files

Fix "Now Playing" view's background flickering

Prevent dynamic binding of sourceSize which causes the background image to be
reloaded frequently when the display size is changing.

To limit the memory usage of the background, set sourceSize to a fixed value
when the original size of the background is very large.

BUG: 431607
parent 578a8878
Pipeline #82517 passed with stage
in 8 minutes and 22 seconds
......@@ -163,9 +163,6 @@ Kirigami.Page {
source: albumArtUrl.toString() === '' ? Qt.resolvedUrl(elisaTheme.defaultAlbumImage) : albumArtUrl
sourceSize.width: topItem.width
sourceSize.height: topItem.height
asynchronous: true
fillMode: Image.PreserveAspectCrop
......@@ -177,6 +174,9 @@ Kirigami.Page {
// anchors.fill: parent
radius: 40
}
// HACK: set sourceSize to a fixed value to prevent background flickering (BUG431607)
onStatusChanged: if (status === Image.Ready && (sourceSize.width > Kirigami.Units.gridUnit * 50 || sourceSize.height > Kirigami.Units.gridUnit * 50)) sourceSize = Qt.size(Kirigami.Units.gridUnit * 50, Kirigami.Units.gridUnit * 50)
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment