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
31 property bool resizeSurface: true
35 surfaceItem.surface = surface;
36 root.hadSurface = false;
42 onTargetPressedChanged: {
43 if (targetPressed && root.interactive) {
45 root.forceActiveFocus();
52 objectName: "surfaceItem"
56 surfaceWidth: root.resizeSurface ? width : -1
57 surfaceHeight: root.resizeSurface ? height : -1
60 enabled: root.interactive
62 antialiasing: !root.interactive
63 orientationAngle: root.surfaceOrientationAngle
67 targetItem: surfaceItem
69 enabled: surfaceItem.enabled
75 when: surfaceItem.surface && !surfaceItem.live
80 from: ""; to: "zombie"
82 UbuntuNumberAnimation { target: surfaceItem; property: "opacity"; to: 0.0
83 duration: UbuntuAnimation.BriskDuration }
84 PropertyAction { target: surfaceItem; property: "visible"; value: false }
85 ScriptAction { script: {
86 surfaceItem.surface = null;
87 root.hadSurface = true;
92 from: "zombie"; to: ""
93 ScriptAction { script: {
94 surfaceItem.opacity = 1.0;
95 surfaceItem.visible = true;