2 * Copyright 2014 Canonical Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 objectName: "sessionContainer"
23 property QtObject session
24 readonly property var childSessions: session ? session.childSessions : null
25 readonly property alias surface: _surfaceContainer.surface
26 property alias interactive: _surfaceContainer.interactive
27 property int orientation
29 readonly property alias surfaceContainer: _surfaceContainer
33 surface: session ? session.surface : null
34 orientation: root.orientation
39 model: root.childSessions
42 objectName: "childDelegate" + index
43 anchors.fill: surfaceContainer
45 // Only way to do recursive qml items.
46 source: Qt.resolvedUrl("SessionContainer.qml")
49 target: item; when: item
50 property: "interactive"; value: root.interactive
54 target: item; when: item
55 property: "session"; value: modelData
59 target: item; when: item
60 property: "width"; value: root.width
64 target: item; when: item
65 property: "height"; value: root.height
69 target: item; when: item
70 property: "orientation"; value: root.orientation
78 when: root.session && !root.session.parentSession
83 when: root.session && root.session.parentSession !== null && root.session.live
84 && !root.session.surface
88 name: "childSessionReady"
89 when: root.session && root.session.parentSession !== null && root.session.live
90 && root.session.surface !== null
94 name: "childSessionZombie"
95 when: root.session && root.session.parentSession !== null && !root.session.live
101 to: "childSessionReady"
102 ScriptAction { script: { if (!surfaceContainer.hadSurface) { animateIn(swipeFromBottom); } } }
105 to: "childSessionZombie"
106 ScriptAction { script: { animateOut(); } }
110 function animateIn(component) {
111 var animation = component.createObject(root, { "container": root, });
114 var tmp = d.animations;
119 function animateOut() {
120 if (d.animations.length > 0) {
121 var tmp = d.animations;
122 var popped = tmp.pop();
123 popped.completed.connect(function() { root.session.release(); } );
131 SwipeFromBottomAnimation {}
136 property var animations: []