@@ -54,35 +54,66 @@ Item {
55 // Only way to do recursive qml items.
55 // Only way to do recursive qml items.
56 source: Qt.resolvedUrl("SessionContainer.qml")
56 source: Qt.resolvedUrl("SessionContainer.qml")
58− item.session = modelData;
58+ Binding {
59− item.interactive = Qt.binding(function() { return root.interactive; } );
59+ target: item; when: item
60− if (!modelData.live) {
60+ property: "interactive"; value: root.interactive
61− modelData.release();
61+ }
63− if (modelData.surface) {
63+ Binding {
64− item.animateIn(swipeFromBottom);
64+ target: item; when: item
65− }
65+ property: "session"; value: modelData
68− Connections {
68+ Binding {
69− target: modelData
69+ target: item; when: item
70− onSurfaceChanged: {
70+ property: "width"; value: root.width
71− if (modelData.surface) {
75− onLiveChanged: {
73+ Binding {
76− if (!modelData.live) {
74+ target: item; when: item
77− item.animateOut();
75+ property: "height"; value: root.height
83+ when: root.session && !root.session.parentSession
88+ when: root.session && root.session.parentSession !== null && root.session.live
89+ && !root.session.surface
93+ name: "childSessionReady"
94+ when: root.session && root.session.parentSession !== null && root.session.live
95+ && root.session.surface !== null
99+ name: "childSessionZombie"
100+ when: root.session && root.session.parentSession !== null && !root.session.live
106+ to: "childSessionReady"
107+ ScriptAction { script: { if (!surfaceContainer.hadSurface) { animateIn(swipeFromBottom); } } }
110+ to: "childSessionZombie"
111+ ScriptAction { script: { animateOut(); } }
84− function animateIn() {
115+ function animateIn(component) {
85− var animation = swipeFromBottom.createObject(root, { "container": root, });
116+ var animation = component.createObject(root, { "container": root, });
86 animation.start();
117 animation.start();
88 var tmp = d.animations;
119 var tmp = d.animations;
@@ -94,6 +125,7 @@ Item {
94 if (d.animations.length > 0) {
125 if (d.animations.length > 0) {
95 var tmp = d.animations;
126 var tmp = d.animations;
96 var popped = tmp.pop();
127 var popped = tmp.pop();
128+ popped.completed.connect(function() { root.session.release(); } );
97 popped.end();
129 popped.end();
98 d.animations = tmp;
130 d.animations = tmp;