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

Solves reloading and rescaling the image on every resize of the window

commitb9a10ca2df59e89a91db51e8b8c51aa789052ed6 authorAlbert Astals Cid <albert.astals@canonical.com> dateThu 29 Oct 2015, 17:49 (11 years ago) parent5637c5d
1 file changed+3−1
qml/Dash/DashBackground.qml+3−1
qml/Dash/DashBackground.qml+3−1
@@ -15,12 +15,14 @@
1515 */
1616
1717import QtQuick 2.0
18+import QtQuick.Window 2.2
1819
1920Image {
2021 source: anchors.fill.width > anchors.fill.height ? "graphics/paper_landscape.png" : "graphics/paper_portrait.png"
2122 fillMode: Image.PreserveAspectCrop
2223 horizontalAlignment: Image.AlignRight
2324 verticalAlignment: Image.AlignTop
24− sourceSize.width: anchors.fill.width
25+ property int maxSize: Math.max(Screen.width, Screen.height)
26+ sourceSize.width: maxSize
2527 sourceSize.height: 0
2628}