on aa2feff help sign in
unity8/qml/Tutorial/TutorialLeft.qml
76 lines 2.1 kB history raw
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 */
17import QtQuick 2.3
18import Ubuntu.Components 1.1
19import "." as LocalComponents
21TutorialPage {
22 id: root
24 property var launcher
26 title: i18n.tr("Open the launcher")
27 text: i18n.tr("Short swipe from the left edge.")
28 errorText: i18n.tr("Too far!") + "\n" + i18n.tr("Try again.")
30 textXOffset: root.launcher.visibleWidth
32 Connections {
33 target: root.launcher
35 onStateChanged: {
36 if (root.launcher.state === "visible") {
37 finishTimer.start();
38 }
39 }
41 onDash: {
42 finishTimer.stop();
43 root.showError();
44 root.launcher.hide();
45 }
46 }
48 Timer {
49 id: teaseTimer
50 interval: UbuntuAnimation.SleepyDuration
51 repeat: true
52 running: !root.paused && !root.launcher.dragging
53 onTriggered: root.launcher.tease(UbuntuAnimation.SleepyDuration)
54 }
56 Timer {
57 id: finishTimer
58 interval: 1
59 onTriggered: root.hide()
60 }
62 foreground {
63 children: [
64 LocalComponents.Slider {
65 anchors {
66 left: parent.left
67 top: parent.top
68 topMargin: root.textBottom + units.gu(3)
69 }
70 offset: root.launcher.visibleWidth + root.launcher.progress
71 active: root.launcher.dragging
72 shortSwipe: true
73 }
74 ]
75 }