@@ -0,0 +1,95 @@
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/>.
21+ property Item surface: null
22+ property string animation
23+ property bool show: false
27+ surface.parent = container;
28+ surface.anchors.fill = container;
34+ model: container.surface ? container.surface.childSurfaces : 0
38+ anchors.fill: surface
40+ // Only way to do recursive qml items.
41+ source: Qt.resolvedUrl("SurfaceContainer.qml")
43+ item.parent = container.surface;
44+ item.surface = modelData;
45+ item.animation = "overlaySwipeBottom"
53+ name: "baseAnimation"
54+ PropertyChanges { target: surface; anchors.fill: undefined }
58+ name: "overlaySwipeBottom-out"
59+ extend: "baseAnimation"
60+ when: surface && animation === "overlaySwipeBottom" && !show
61+ AnchorChanges { target: surface; anchors.top: surface.parent.bottom }
64+ name: "overlaySwipeBottom-in"
65+ extend: "baseAnimation"
66+ when: surface && animation === "overlaySwipeBottom" && show
67+ AnchorChanges { target: surface; anchors.top: surface.parent.top }
70+ // TODO: more animations!
71+ // Surface needs to stick around so that we can dimiss them with animation.
76+ from: "overlaySwipeBottom-out"
77+ to: "overlaySwipeBottom-in"
78+ SequentialAnimation {
79+ PropertyAction { target: surface.parent; property: "clip"; value: true}
80+ AnchorAnimation { easing.type: Easing.InOutQuad; duration: 400 }
81+ PropertyAction { target: surface.parent; property: "clip"; value: false}
85+ from: "overlaySwipeBottom-in"
86+ to: "overlaySwipeBottom-out"
87+ SequentialAnimation {
88+ PropertyAction { target: surface.parent; property: "clip"; value: true}
89+ AnchorAnimation { easing.type: Easing.InOutQuad; duration: 400 }
90+ PropertyAction { target: surface; property: "visible"; value: false}
91+ PropertyAction { target: surface.parent; property: "clip"; value: false}