2 * Copyright 2014 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
23 objectName: "surfaceContainer"
24 property Item surface: null
25 property bool hadSurface: false
26 property int orientation
27 property bool interactive
29 signal surfacePressed()
33 // Set the surface focus *after* it is added to the scene to
34 // ensure an update to the scene's active focus.
35 surface.focus = false;
36 surface.parent = root;
42 Binding { target: surface; property: "anchors.fill"; value: root }
43 Binding { target: surface; property: "orientation"; value: root.orientation }
44 Binding { target: surface; property: "z"; value: 1 }
45 Binding { target: surface; property: "enabled"; value: root.interactive; when: surface }
46 Binding { target: surface; property: "antialiasing"; value: !root.interactive; when: surface }
51 enabled: root.surface ? root.surface.enabled : false
55 if (root.interactive) {
56 root.forceActiveFocus();
64 when: surface && !surface.live
69 from: ""; to: "zombie"
71 UbuntuNumberAnimation { target: surface; property: "opacity"; to: 0.0
72 duration: UbuntuAnimation.BriskDuration }
73 PropertyAction { target: surface; property: "visible"; value: false }
74 ScriptAction { script: { if (root.surface) { root.surface.release(); } } }