@@ -120,6 +120,15 @@ FocusScope {
120120
121121 function updateImage() {
122122 if (testImage.status == Image.Ready) {
123+ if (shell.width / shell.height <= testImage.sourceSize.width / testImage.sourceSize.height) {
124+ backgroundImage.sourceSize = undefined
125+ backgroundImage.sourceSize.height = shell.height
126+ }
127+ else {
128+ backgroundImage.sourceSize = undefined
129+ backgroundImage.sourceSize.width = shell.width
130+ }
131+
123132 shell.background = testImage.source
124133 } else if (testImage.status == Image.Error) {
125134 shell.background = shell.default_background
@@ -157,8 +166,6 @@ FocusScope {
157166 Image {
158167 id: backgroundImage
159168 source: shell.background
160− sourceSize.width: parent.width
161− sourceSize.height: parent.height
162169 anchors.fill: parent
163170 fillMode: Image.PreserveAspectCrop
164171 }