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 bool interactive: true
28 readonly property alias surfaceContainer: _surfaceContainer
32 surface: session ? session.surface : null
36 target: surfaceContainer.surface
37 when: surfaceContainer.surface
39 value: root.interactive
42 target: surfaceContainer.surface
43 when: surfaceContainer.surface
45 value: root.interactive
49 model: root.childSessions
52 objectName: "childDelegate" + index
53 anchors.fill: surfaceContainer
55 // Only way to do recursive qml items.
56 source: Qt.resolvedUrl("SessionContainer.qml")
59 target: item; when: item
60 property: "interactive"; value: root.interactive
64 target: item; when: item
65 property: "session"; value: modelData
69 target: item; when: item
70 property: "width"; value: root.width
74 target: item; when: item
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(); } }
115 function animateIn(component) {
116 var animation = component.createObject(root, { "container": root, });
119 var tmp = d.animations;
124 function animateOut() {
125 if (d.animations.length > 0) {
126 var tmp = d.animations;
127 var popped = tmp.pop();
128 popped.completed.connect(function() { root.session.release(); } );
136 SwipeFromBottomAnimation {}
141 property var animations: []