diff --git a/wallpapers/image/imagepackage/contents/ui/main.qml b/wallpapers/image/imagepackage/contents/ui/main.qml --- a/wallpapers/image/imagepackage/contents/ui/main.qml +++ b/wallpapers/image/imagepackage/contents/ui/main.qml @@ -34,7 +34,6 @@ property Item otherImage: imageA property Item otherBlurBackground: blurBackgroundA readonly property int fillMode: wallpaper.configuration.FillMode - property bool ready: false property size sourceSize: Qt.size(root.width * Screen.devicePixelRatio, root.height * Screen.devicePixelRatio) //public API, the C++ part will look for those @@ -52,13 +51,16 @@ } //private - function fadeWallpaper() { - if (!ready && width > 0 && height > 0) { // shell startup, setup immediately - currentImage.sourceSize = root.sourceSize - currentImage.source = modelImage + function setupImage() { + currentImage.sourceSize = root.sourceSize; + currentImage.fillMode = root.fillMode; + currentImage.source = modelImage; + } - ready = true - return + function fadeWallpaper() { + if (startupTimer.running) { + setupImage(); + return; } fadeAnim.running = false @@ -84,6 +86,11 @@ } function fadeFillMode() { + if (startupTimer.running) { + setupImage(); + return; + } + fadeAnim.running = false swapImages() currentImage.sourceSize = root.sourceSize @@ -110,6 +117,11 @@ return } + if (startupTimer.running) { + setupImage(); + return; + } + fadeAnim.running = false swapImages() currentImage.sourceSize = root.sourceSize @@ -148,6 +160,13 @@ onWidthChanged: startFadeSourceTimer() onHeightChanged: startFadeSourceTimer() + // HACK prevent fades and transitions during startup + Timer { + id: startupTimer + interval: 100 + running: true + } + Timer { id: sourceSizeTimer interval: 1000 // always delay reloading the image even when animations are turned off @@ -229,10 +248,11 @@ Rectangle { id: backgroundColor anchors.fill: parent - visible: ready && (currentImage.status === Image.Ready || otherImage.status === Image.Ready) + visible: currentImage.status === Image.Ready || otherImage.status === Image.Ready color: wallpaper.configuration.Color Behavior on color { ColorAnimation { duration: units.longDuration } + enabled: !startupTimer.running } }