@@ -16,18 +16,42 @@
17import QtQuick 2.0
17import QtQuick 2.0
19+/* This is the base case for surface animations, used when adding/removing * child surfaces.
20+ * The class is meant to be overridden and changes/animations provided for state changes.
21+ * NB. It is important to release the surface at the end of the "out" animation.
23+ * Example - Simple fade in/out
25+ * BaseSurfaceAnimation {
26+ * outChanges: [ PropertyChanges { target: animation.surface; opacity: 0.0 } ]
28+ SequentialAnimation {
29+ * NumberAnimation { target: animation.surface; property: "opacity"; duration: 300 }
30+ * ScriptAction { script: { if (animation.parent.removing) animation.surface.release(); } }
34+ * inChanges: [ PropertyChanges { target: animation.surface; opacity: 1.0 } ]
35+ * inAnimations: [ NumberAnimation { target: animation.surface; property: "opacity"; duration: 300 } ]
21 property Item surface: null
40 property Item surface: null
22 property Item surfaceArea: null
41 property Item surfaceArea: null
43+ // changes applied when state changes to "in"
24 property list<QtObject> outChanges
44 property list<QtObject> outChanges
45+ // transition animations when changing state to "in"
25 property list<QtObject> outAnimations
46 property list<QtObject> outAnimations
48+ // changes applied when state changes to "out"
27 property list<QtObject> inChanges
49 property list<QtObject> inChanges
50+ // transition animations when changing state to "out"
28 property list<QtObject> inAnimations
51 property list<QtObject> inAnimations
30 function start() {
53 function start() {
54+ // "prep" state forces outChanges without transition animations.
31 state = "prep"
55 state = "prep"
32 state = "in";
56 state = "in";