revert wallpaper
This commit is contained in:
@@ -29,17 +29,19 @@ Item {
|
|||||||
|
|
||||||
Img {
|
Img {
|
||||||
id: one
|
id: one
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Img {
|
Img {
|
||||||
id: two
|
id: two
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
component Img: CachingImage {
|
component Img: CachingImage {
|
||||||
id: img
|
id: img
|
||||||
|
|
||||||
|
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
|
||||||
|
property real windowRatio: root.width / Math.max(1, root.height)
|
||||||
|
|
||||||
function update(): void {
|
function update(): void {
|
||||||
if (path === root.source) {
|
if (path === root.source) {
|
||||||
root.current = this;
|
root.current = this;
|
||||||
@@ -50,22 +52,14 @@ Item {
|
|||||||
|
|
||||||
anchors.fill: undefined
|
anchors.fill: undefined
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
opacity: 0
|
fillMode: Image.PreserveAspectCrop
|
||||||
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
|
height: isValid ? (imageRatio > windowRatio ? root.height : root.width / imageRatio) * Config.background.zoom : root.height
|
||||||
|
opacity: 0
|
||||||
|
scale: Wallpapers.showPreview ? 1 : 0.8
|
||||||
|
width: isValid ? (imageRatio > windowRatio ? root.height * imageRatio : root.width) * Config.background.zoom : root.width
|
||||||
x: isValid ? (root.width - width) * Config.background.alignX : 0
|
x: isValid ? (root.width - width) * Config.background.alignX : 0
|
||||||
y: isValid ? (root.height - height) * Config.background.alignY : 0
|
y: isValid ? (root.height - height) * Config.background.alignY : 0
|
||||||
|
|
||||||
scale: Wallpapers.showPreview ? 1 : 0.8
|
|
||||||
|
|
||||||
states: State {
|
states: State {
|
||||||
name: "visible"
|
name: "visible"
|
||||||
when: root.current === img
|
when: root.current === img
|
||||||
|
|||||||
Reference in New Issue
Block a user