wallpaper cropper start, doesn't work.

This commit is contained in:
2026-04-13 00:00:51 +02:00
parent 3dbe83a0e1
commit 52302057ba
5 changed files with 131 additions and 2 deletions
+14 -1
View File
@@ -48,9 +48,22 @@ Item {
}
}
anchors.fill: parent
anchors.fill: undefined
asynchronous: true
opacity: 0
fillMode: Image.Stretch
property real windowRatio: root.width / Math.max(1, root.height)
property real imageRatio: Math.max(1, sourceSize.width) / Math.max(1, sourceSize.height)
property bool isValid: sourceSize.width > 0 && sourceSize.height > 0 && root.width > 0 && root.height > 0
width: isValid ? (imageRatio > windowRatio ? root.height * imageRatio : root.width) * Config.background.zoom : root.width
height: isValid ? (imageRatio > windowRatio ? root.height : root.width / imageRatio) * Config.background.zoom : root.height
x: isValid ? (root.width - width) * Config.background.alignX : 0
y: isValid ? (root.height - height) * Config.background.alignY : 0
scale: Wallpapers.showPreview ? 1 : 0.8
states: State {