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
24 objectName: "surfaceContainer"
25 property Item surface: null
26 property bool hadSurface: false
27 property bool interactive
28 property int surfaceOrientationAngle: 0
32 // Set the surface focus *after* it is added to the scene to
33 // ensure an update to the scene's active focus.
34 surface.focus = false;
35 surface.parent = root;
41 Binding { target: surface; property: "anchors.fill"; value: root }
42 Binding { target: surface; property: "z"; value: 1 }
43 Binding { target: surface; property: "enabled"; value: root.interactive; when: surface }
44 Binding { target: surface; property: "antialiasing"; value: !root.interactive; when: surface }
45 Binding { target: surface; property: "orientationAngle"; value: root.surfaceOrientationAngle; when: surface }
49 onTargetPressedChanged: {
50 if (targetPressed && root.interactive) {
52 root.forceActiveFocus();
60 enabled: root.surface ? root.surface.enabled : false
67 when: surface && !surface.live
72 from: ""; to: "zombie"
74 UbuntuNumberAnimation { target: surface; property: "opacity"; to: 0.0
75 duration: UbuntuAnimation.BriskDuration }
76 PropertyAction { target: surface; property: "visible"; value: false }
77 ScriptAction { script: { if (root.surface) { root.surface.release(); } } }