on daa5708 help sign in
unity8/qml/Tutorial/TutorialContent.qml
124 lines 3.0 kB history raw
1/*
2 * Copyright (C) 2013,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 */
17import QtQuick 2.3
18import Ubuntu.Components 1.1
20Item {
21 id: root
23 property Item launcher
24 property Item panel
25 property Item stages
26 property Item overlay
28 readonly property bool launcherEnabled: !running ||
29 (!paused && tutorialLeft.shown)
30 readonly property bool spreadEnabled: !running
31 readonly property bool panelEnabled: !running
32 readonly property bool panelContentEnabled: !running
33 readonly property alias running: d.running
35 property bool paused: false
36 property real edgeSize
38 signal finished()
40 function finish() {
41 d.stop();
42 finished();
43 }
45 ////
47 Component.onCompleted: {
48 d.start();
49 }
51 QtObject {
52 id: d
54 property bool running
56 function stop() {
57 running = false;
58 }
60 function start() {
61 running = true;
62 tutorialLeft.show();
63 }
64 }
66 TutorialLeft {
67 id: tutorialLeft
68 objectName: "tutorialLeft"
69 parent: root.stages
70 anchors.fill: parent
71 launcher: root.launcher
72 paused: !shown || root.paused
74 onFinished: tutorialLeftFinish.show()
75 }
77 TutorialLeftFinish {
78 id: tutorialLeftFinish
79 objectName: "tutorialLeftFinish"
80 parent: root.stages
81 anchors.fill: parent
82 textXOffset: root.launcher.panelWidth
83 paused: !shown || root.paused
85 onFinished: {
86 root.launcher.hide();
87 tutorialRight.show();
88 }
89 }
91 TutorialRight {
92 id: tutorialRight
93 objectName: "tutorialRight"
94 parent: root.stages
95 anchors.fill: parent
96 edgeSize: root.edgeSize
97 panel: root.panel
98 paused: !shown || root.paused
100 onFinished: tutorialBottom.show()
101 }
103 TutorialBottom {
104 id: tutorialBottom
105 objectName: "tutorialBottom"
106 parent: root.stages
107 anchors.fill: parent
108 edgeSize: root.edgeSize
109 paused: !shown || root.paused
111 onFinished: tutorialBottomFinish.show()
112 }
114 TutorialBottomFinish {
115 id: tutorialBottomFinish
116 objectName: "tutorialBottomFinish"
117 parent: root.stages
118 anchors.fill: parent
119 backgroundFadesOut: true
120 paused: !shown || root.paused
122 onFinished: root.finish()
123 }