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.3
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
31 property string name: surface ? surface.name : ""
32 property bool resizeSurface: true
36 surfaceItem.surface = surface;
37 root.hadSurface = false;
43 onTargetPressedChanged: {
44 if (targetPressed && root.interactive) {
46 root.forceActiveFocus();
53 objectName: "surfaceItem"
57 surfaceWidth: root.resizeSurface ? width : -1
58 surfaceHeight: root.resizeSurface ? height : -1
61 enabled: root.interactive
63 antialiasing: !root.interactive
64 orientationAngle: root.surfaceOrientationAngle
68 targetItem: surfaceItem
70 enabled: surfaceItem.enabled
76 when: surfaceItem.surface && !surfaceItem.live
81 from: ""; to: "zombie"
83 UbuntuNumberAnimation { target: surfaceItem; property: "opacity"; to: 0.0
84 duration: UbuntuAnimation.BriskDuration }
85 PropertyAction { target: surfaceItem; property: "visible"; value: false }
86 ScriptAction { script: {
87 surfaceItem.surface = null;
88 root.hadSurface = true;
93 from: "zombie"; to: ""
94 ScriptAction { script: {
95 surfaceItem.opacity = 1.0;
96 surfaceItem.visible = true;