on xenial help sign in
Set the background source size to the max we'll need + new background

Solves async reloading and rescaling the image on every horizontal resize of the window Fixes: #1539011 Approved by: Michał Sawicz, Gerry Boland

commit2c64b7b0ecc6ad09a80677d77e2d7a36c4351e52 authorAlbert Astals Cid <albert.astals@canonical.com> dateFri 29 Jan 2016, 11:53 (11 years ago) parentb820e73797da7b
4 files changed+6−2
qml/Dash/DashBackground.qml+6−2 qml/Dash/graphics/paper.png qml/Dash/graphics/paper_landscape@27.png qml/Dash/graphics/paper_portrait@27.png
qml/Dash/DashBackground.qml+6−2
@@ -15,12 +15,16 @@
1515 */
1616
1717import QtQuick 2.4
18+import QtQuick.Window 2.2
19+import Ubuntu.Thumbnailer 0.1
1820
1921Image {
20− source: anchors.fill.width > anchors.fill.height ? "graphics/paper_landscape.png" : "graphics/paper_portrait.png"
22+ source: "image://thumbnailer/" + Qt.resolvedUrl("graphics/paper.png")
2123 fillMode: Image.PreserveAspectCrop
2224 horizontalAlignment: Image.AlignRight
2325 verticalAlignment: Image.AlignTop
24− sourceSize.width: anchors.fill.width
26+ // avoid CPU scaling when window size changes
27+ readonly property int maxSize: Math.max(Screen.width, Screen.height)
28+ sourceSize.width: maxSize
2529 sourceSize.height: 0
2630}
qml/Dash/graphics/paper.pngnew file

Binary file not shown.

qml/Dash/graphics/paper_landscape@27.pngdeleted

Binary file not shown.

qml/Dash/graphics/paper_portrait@27.pngdeleted

Binary file not shown.