Unity 8
Tutorial.qml
1 /*
2  * Copyright (C) 2014 Canonical, Ltd.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; version 3.
7  *
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 General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 import QtQuick 2.3
18 import Ubuntu.Components 1.1
19 
20 Item {
21  id: root
22 
23  property alias active: loader.active
24  property bool paused
25  property real edgeSize
26  property bool useEdgeDragArea
27 
28  property Item launcher
29  property Item panel
30 
31  readonly property bool launcherEnabled: loader.item ? loader.item.launcherEnabled : true
32  readonly property bool spreadEnabled: loader.item ? loader.item.spreadEnabled : true
33  readonly property bool panelEnabled: loader.item ? loader.item.panelEnabled : true
34  readonly property bool panelContentEnabled: loader.item ? loader.item.panelContentEnabled : true
35  readonly property bool running: loader.item ? loader.item.running : false
36 
37  function finish() {
38  if (loader.item) {
39  loader.item.finish();
40  }
41  }
42 
43  signal finished()
44 
45  Loader {
46  id: loader
47  anchors.fill: parent
48  source: "TutorialContent.qml"
49 
50  Binding {
51  target: loader.item
52  property: "paused"
53  value: root.paused
54  }
55 
56  Binding {
57  target: loader.item
58  property: "edgeSize"
59  value: root.edgeSize
60  }
61 
62  Binding {
63  target: loader.item
64  property: "useEdgeDragArea"
65  value: root.useEdgeDragArea
66  }
67 
68  Binding {
69  target: loader.item
70  property: "launcher"
71  value: root.launcher
72  }
73 
74  Binding {
75  target: loader.item
76  property: "panel"
77  value: root.panel
78  }
79 
80  Connections {
81  target: loader.item
82  onFinished: root.finished()
83  }
84  }
85 }