on f41454c help sign in
unity8/qml/Tutorial/TutorialContent.qml
118 lines 2.9 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.4
18import Ubuntu.Components 1.3
20Item {
21 id: root
23 property Item launcher
24 property Item panel
26 readonly property bool launcherEnabled: !running ||
27 (!paused && tutorialLeft.shown)
28 readonly property bool spreadEnabled: !running
29 readonly property bool panelEnabled: !running
30 readonly property bool panelContentEnabled: !running
31 readonly property alias running: d.running
33 property bool paused: false
34 property real edgeSize
36 signal finished()
38 function finish() {
39 d.stop();
40 finished();
41 }
43 ////
45 Component.onCompleted: {
46 d.start();
47 }
49 QtObject {
50 id: d
52 property bool running
54 function stop() {
55 running = false;
56 }
58 function start() {
59 running = true;
60 tutorialLeft.show();
61 }
62 }
64 TutorialLeft {
65 id: tutorialLeft
66 objectName: "tutorialLeft"
67 anchors.fill: parent
68 launcher: root.launcher
69 paused: !shown || root.paused
71 onFinished: tutorialLeftFinish.show()
72 }
74 TutorialLeftFinish {
75 id: tutorialLeftFinish
76 objectName: "tutorialLeftFinish"
77 anchors.fill: parent
78 textXOffset: root.launcher.panelWidth
79 paused: !shown || root.paused
80 text: i18n.tr("Tap here to continue.")
82 onFinished: {
83 root.launcher.hide();
84 tutorialRight.show();
85 }
86 }
88 TutorialRight {
89 id: tutorialRight
90 objectName: "tutorialRight"
91 anchors.fill: parent
92 edgeSize: root.edgeSize
93 panel: root.panel
94 paused: !shown || root.paused
96 onFinished: tutorialBottom.show()
97 }
99 TutorialBottom {
100 id: tutorialBottom
101 objectName: "tutorialBottom"
102 anchors.fill: parent
103 edgeSize: root.edgeSize
104 paused: !shown || root.paused
106 onFinished: tutorialBottomFinish.show()
107 }
109 TutorialBottomFinish {
110 id: tutorialBottomFinish
111 objectName: "tutorialBottomFinish"
112 anchors.fill: parent
113 backgroundFadesOut: true
114 paused: !shown || root.paused
116 onFinished: root.finish()
117 }