1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-06 19:12:30 +01:00
ScreenPlay/ScreenPlayWorkshop/qml/InstalledItemImage.qml
Elias Steurer d358c4f920 WIP Refactor wallpaper timeline logic
TODO:
- Fix qcoro // QMetaObject::invokeMethod( requestSaveProfiles call
2024-08-14 14:06:53 +02:00

61 lines
1.2 KiB
QML

import QtQuick
Item {
id: root
property string sourceImage
property string sourceImageGIF
width: 320
height: 121
state: "loading"
Image {
id: image
anchors.fill: parent
fillMode: Image.PreserveAspectCrop
source: root.sourceImage.trim()
onStatusChanged: {
if (image.status === Image.Ready) {
root.state = "loaded";
} else if (image.status === Image.Error) {
source = "images/missingPreview.png";
root.state = "loaded";
}
}
}
states: [
State {
name: "loading"
PropertyChanges {
target: image
opacity: 0
}
},
State {
name: "loaded"
PropertyChanges {
target: image
opacity: 1
}
}
]
transitions: [
Transition {
from: "loading"
to: "loaded"
NumberAnimation {
target: image
property: "opacity"
duration: 300
easing.type: Easing.InOutQuad
}
}
]
}