2 * Copyright 2014-2015 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/>.
18 import Ubuntu.Components 1.1
19 import Ubuntu.Gestures 0.1 // For TouchGate
20 import Utils 0.1 // for InputWatcher
21 import Unity.Application 0.1 // for MirSurfaceItem
25 objectName: "surfaceContainer"
27 property var surface: null
28 property bool hadSurface: false
29 property bool interactive
30 property int surfaceOrientationAngle: 0
34 surfaceItem.surface = surface;
35 root.hadSurface = false;
41 onTargetPressedChanged: {
42 if (targetPressed && root.interactive) {
44 root.forceActiveFocus();
51 objectName: "surfaceItem"
59 enabled: root.interactive
61 antialiasing: !root.interactive
62 orientationAngle: root.surfaceOrientationAngle
66 targetItem: surfaceItem
68 enabled: surfaceItem.enabled
74 when: surfaceItem.surface && !surfaceItem.live
79 from: ""; to: "zombie"
81 UbuntuNumberAnimation { target: surfaceItem; property: "opacity"; to: 0.0
82 duration: UbuntuAnimation.BriskDuration }
83 PropertyAction { target: surfaceItem; property: "visible"; value: false }
84 ScriptAction { script: {
85 surfaceItem.surface = null;
86 root.hadSurface = true;
91 from: "zombie"; to: ""
92 ScriptAction { script: {
93 surfaceItem.opacity = 1.0;
94 surfaceItem.visible = true;