on xenial help sign in
Add long-swipe-from-left-edge screen
d64d02dMichael Terry
qml/Tutorial/TutorialContent.qml+50−5
@@ -30,7 +30,9 @@ Item {
30 property bool keyboardVisible
30 property bool keyboardVisible
31 property var lastInputTimestamp
31 property var lastInputTimestamp
32
32
33− readonly property bool launcherEnabled: !running || tutorialLeftLoader.shown
33+ readonly property bool launcherEnabled: !running
34+ || tutorialLeftLoader.shown
35+ || tutorialLeftLongLoader.shown
34 readonly property bool spreadEnabled: !running || tutorialRightLoader.shown
36 readonly property bool spreadEnabled: !running || tutorialRightLoader.shown
35 readonly property bool panelEnabled: !running || tutorialTopLoader.shown
37 readonly property bool panelEnabled: !running || tutorialTopLoader.shown
36 readonly property bool running: tutorialLeftLoader.shown
38 readonly property bool running: tutorialLeftLoader.shown
@@ -101,6 +103,48 @@ Item {
101 }
103 }
102 }
104 }
103
105
106+ Loader {
107+ id: tutorialLeftLongLoader
108+ objectName: "tutorialLeftLongLoader"
109+ anchors.fill: parent
110+
111+ readonly property bool skipped: !d.mobileScenario || d.haveShown("left-long")
112+ readonly property bool shown: item && item.shown
113+ active: !skipped || (item && item.visible)
114+ onSkippedChanged: if (skipped && shown) item.hide()
115+
116+ sourceComponent: TutorialLeftLong {
117+ id: tutorialLeftLong
118+ objectName: "tutorialLeftLong"
119+ anchors.fill: parent
120+ launcher: root.launcher
121+ hides: [launcher, panel.indicators]
122+ paused: root.paused
123+
124+ skipped: tutorialLeftLongLoader.skipped
125+ isReady: tutorialLeftLoader.skipped && !skipped && !paused && !keyboardVisible &&
126+ !tutorialBottomLoader.shown && !tutorialBottomLoader.mightShow
127+
128+ Timer {
129+ id: tutorialLeftLongTimer
130+ objectName: "tutorialLeftLongTimer"
131+ interval: 5000
132+ onTriggered: {
133+ if (parent.isReady) {
134+ if (!parent.shown) {
135+ parent.show();
136+ }
137+ } else if (!parent.skipped) {
138+ restart();
139+ }
140+ }
141+ }
142+
143+ onIsReadyChanged: if (isReady && !shown) tutorialLeftLongTimer.start()
144+ onFinished: AccountsService.markDemoEdgeCompleted("left-long")
145+ }
146+ }
147+
104 Loader {
148 Loader {
105 id: tutorialTopLoader
149 id: tutorialTopLoader
106 objectName: "tutorialTopLoader"
150 objectName: "tutorialTopLoader"
@@ -119,8 +163,8 @@ Item {
119 hides: [launcher, panel.indicators]
163 hides: [launcher, panel.indicators]
120 paused: root.paused
164 paused: root.paused
121
165
122− isReady: tutorialLeftLoader.skipped && !tutorialTopLoader.skipped &&
166+ skipped: tutorialTopLoader.skipped
123− !paused && !keyboardVisible &&
167+ isReady: tutorialLeftLongLoader.skipped && !skipped && !paused && !keyboardVisible &&
124 !tutorialBottomLoader.shown && !tutorialBottomLoader.mightShow
168 !tutorialBottomLoader.shown && !tutorialBottomLoader.mightShow
125
169
126 // We fire 30s after left edge tutorial, with at least 3s of inactivity
170 // We fire 30s after left edge tutorial, with at least 3s of inactivity
@@ -162,8 +206,8 @@ Item {
162 hides: [launcher, panel.indicators]
206 hides: [launcher, panel.indicators]
163 paused: root.paused
207 paused: root.paused
164
208
165− isReady: tutorialTopLoader.skipped && !tutorialRightLoader.skipped &&
209+ skipped: tutorialRightLoader.skipped
166− !paused && !keyboardVisible &&
210+ isReady: tutorialTopLoader.skipped && !skipped && !paused && !keyboardVisible &&
167 !tutorialBottomLoader.shown && !tutorialBottomLoader.mightShow &&
211 !tutorialBottomLoader.shown && !tutorialBottomLoader.mightShow &&
168 ApplicationManager.count >= 3
212 ApplicationManager.count >= 3
169
213
@@ -231,6 +275,7 @@ Item {
231 stage: root.stage
275 stage: root.stage
232 application: d.focusedApp
276 application: d.focusedApp
233
277
278+ skipped: tutorialBottomLoader.skipped
234 isReady: !tutorialBottomLoader.skipped && !paused && !keyboardVisible &&
279 isReady: !tutorialBottomLoader.skipped && !paused && !keyboardVisible &&
235 !tutorialTopLoader.shown && !tutorialRightLoader.shown &&
280 !tutorialTopLoader.shown && !tutorialRightLoader.shown &&
236 tutorialBottomLoader.mightShow &&
281 tutorialBottomLoader.mightShow &&
qml/Tutorial/TutorialLeftLong.qmlnew file+54
@@ -0,0 +1,54 @@
1+/*
2+ * Copyright (C) 2016 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.4
18+import Ubuntu.Components 1.3
19+import "." as LocalComponents
20+
21+TutorialPage {
22+ id: root
23+
24+ property var launcher
25+
26+ opacityOverride: 1 - launcher.dragDistance / launcher.minimizeDistance
27+
28+ mouseArea {
29+ anchors.leftMargin: launcher.dragAreaWidth
30+ }
31+
32+ background {
33+ sourceSize.height: 1916
34+ sourceSize.width: 1080
35+ source: Qt.resolvedUrl("graphics/background1.png")
36+ mirror: true
37+ }
38+
39+ arrow {
40+ anchors.left: root.left
41+ anchors.leftMargin: units.gu(2)
42+ anchors.verticalCenter: root.verticalCenter
43+ rotation: 180
44+ }
45+
46+ label {
47+ text: i18n.tr("Long swipe from the left edge to open the Today scope")
48+ anchors.left: arrow.right
49+ anchors.leftMargin: units.gu(3)
50+ anchors.right: root.right
51+ anchors.rightMargin: units.gu(4)
52+ anchors.verticalCenter: arrow.verticalCenter
53+ }
54+}
qml/Tutorial/TutorialPage.qml+1
@@ -27,6 +27,7 @@ Showable {
27 property alias mouseArea: mouseArea
27 property alias mouseArea: mouseArea
28 property real opacityOverride: 1
28 property real opacityOverride: 1
29 property bool paused
29 property bool paused
30+ property bool skipped
30 property bool isReady
31 property bool isReady
31
32
32 signal finished()
33 signal finished()