Image {
id: image
- anchors.fill: parent
+ x: 0
+ y: 0
+ width: parent.width
+ height: parent.height
property alias animationRunning: animation.running
- visible: opacity != 0
-
cache: false
fillMode: Image.PreserveAspectFit
SequentialAnimation {
id: animation
+
+ onRunningChanged: {
+ if (!running) {
+ image.visible = false
+ image.x = 0
+ }
+ }
+
PauseAnimation {
- duration: 500
+ duration: 250
alwaysRunToEnd: true
}
NumberAnimation {
- target: preview
- property: "opacity"
- from: 1
- to: 0
+ target: image
+ property: "x"
+ from: 0
+ to: parent.width
duration: 250
alwaysRunToEnd: true
}
function setPreview(preview) {
image.source = preview
- image.opacity = 1
+ image.x = 0
+ image.visible = true
animation.start()
}
}