2 * Copyright 2016 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/>.
18import Lomiri.Components 1.3
22 property var container
23 property var surfaceItem
24 property var hadSurface
29 when: !root.surfaceItem.surface && !root.hadSurface
33 when: root.surfaceItem.surface && root.surfaceItem.live
37 when: root.hadSurface && !root.surfaceItem.live
42 from: "*"; to: "zombie"
43 // Slide downwards until it's out of view, through the bottom of the window
45 // clip so we don't go out of parent's bounds during spread
46 PropertyAction { target: root.container.parent; property: "clip"; value: true }
47 LomiriNumberAnimation { target: root.surfaceItem; property: "anchors.topMargin"; to: root.container.height
48 duration: LomiriAnimation.BriskDuration }
49 PropertyAction { target: root.surfaceItem; property: "visible"; value: false }
50 PropertyAction { target: container.parent; property: "clip"; value: false }
51 ScriptAction { script: {
52 // QtMir.Application can't destroy a zombie MirSurface if it's still being
53 // referenced by a MirSurfaceItem.
54 root.surfaceItem.surface = null;
59 from: "*"; to: "ready"
60 // Slide upwards into view, from the bottom of the window
62 // clip so we don't go out of parent's bounds during spread
63 PropertyAction { target: root.container.parent; property: "clip"; value: true }
64 ScriptAction { script: {
65 root.surfaceItem.visible = true;
67 LomiriNumberAnimation {
68 target: root.surfaceItem; property: "anchors.topMargin"; from: root.container.height; to: 0
69 duration: LomiriAnimation.BriskDuration
71 PropertyAction { target: container.parent; property: "clip"; value: false }
75 from: "*"; to: "blank"
76 ScriptAction { script: {
77 root.surfaceItem.visible = false;