Change HListView transitions to run on scale

This commit is contained in:
miruka 2019-12-15 14:36:24 -04:00
parent 5a3eb2c2e5
commit a9507bdbeb

View File

@ -24,29 +24,41 @@ ListView {
visible: listView.interactive || ! listView.allowDragging
}
// Make sure to handle when a previous transition gets interrupted
add: Transition {
ParallelAnimation {
ScriptAction { script: print("add") }
HNumberAnimation { property: "opacity"; from: 0; to: 1 }
HNumberAnimation { properties: "x,y"; from: 100 }
HNumberAnimation { property: "scale"; from: 0; to: 1 }
}
}
move: Transition {
ParallelAnimation {
// Ensure opacity goes to 1 if add/remove transition is interrupted
ScriptAction { script: print("move") }
HNumberAnimation { property: "opacity"; to: 1 }
HNumberAnimation { property: "scale"; to: 1 }
HNumberAnimation { properties: "x,y" }
}
}
remove: Transition {
ParallelAnimation {
ScriptAction { script: print("remove") }
HNumberAnimation { property: "opacity"; to: 0 }
HNumberAnimation { properties: "x,y"; to: 100 }
HNumberAnimation { property: "scale"; to: 0 }
}
}
displaced: move
// displaced: move
displaced: Transition {
ParallelAnimation {
ScriptAction { script: print("displaced") }
HNumberAnimation { property: "opacity"; to: 1 }
HNumberAnimation { property: "scale"; to: 1 }
HNumberAnimation { properties: "x,y" }
}
}
property bool allowDragging: true