on xenial help sign in
Add long-swipe-from-left-edge screen
commitd64d02d68bc1826bfc6ff89c10a04f6e9c2381ea authorMichael Terry <michael.terry@canonical.com> dateFri 19 Feb 2016, 12:40 (11 years ago) parentd5e2071
3 files changed+105−5
qml/Tutorial/TutorialContent.qml+50−5 qml/Tutorial/TutorialLeftLong.qml+54 qml/Tutorial/TutorialPage.qml+1
qml/Tutorial/TutorialContent.qml+50−5
@@ -30,7 +30,9 @@ Item {
3030 property bool keyboardVisible
3131 property var lastInputTimestamp
3232
33− readonly property bool launcherEnabled: !running || tutorialLeftLoader.shown
33+ readonly property bool launcherEnabled: !running
34+ || tutorialLeftLoader.shown
35+ || tutorialLeftLongLoader.shown
3436 readonly property bool spreadEnabled: !running || tutorialRightLoader.shown
3537 readonly property bool panelEnabled: !running || tutorialTopLoader.shown
3638 readonly property bool running: tutorialLeftLoader.shown
@@ -101,6 +103,48 @@ Item {
101103 }
102104 }
103105
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+
104148 Loader {
105149 id: tutorialTopLoader
106150 objectName: "tutorialTopLoader"
@@ -119,8 +163,8 @@ Item {
119163 hides: [launcher, panel.indicators]
120164 paused: root.paused
121165
122− isReady: tutorialLeftLoader.skipped && !tutorialTopLoader.skipped &&
123− !paused && !keyboardVisible &&
166+ skipped: tutorialTopLoader.skipped
167+ isReady: tutorialLeftLongLoader.skipped && !skipped && !paused && !keyboardVisible &&
124168 !tutorialBottomLoader.shown && !tutorialBottomLoader.mightShow
125169
126170 // We fire 30s after left edge tutorial, with at least 3s of inactivity
@@ -162,8 +206,8 @@ Item {
162206 hides: [launcher, panel.indicators]
163207 paused: root.paused
164208
165− isReady: tutorialTopLoader.skipped && !tutorialRightLoader.skipped &&
166− !paused && !keyboardVisible &&
209+ skipped: tutorialRightLoader.skipped
210+ isReady: tutorialTopLoader.skipped && !skipped && !paused && !keyboardVisible &&
167211 !tutorialBottomLoader.shown && !tutorialBottomLoader.mightShow &&
168212 ApplicationManager.count >= 3
169213
@@ -231,6 +275,7 @@ Item {
231275 stage: root.stage
232276 application: d.focusedApp
233277
278+ skipped: tutorialBottomLoader.skipped
234279 isReady: !tutorialBottomLoader.skipped && !paused && !keyboardVisible &&
235280 !tutorialTopLoader.shown && !tutorialRightLoader.shown &&
236281 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 {
2727 property alias mouseArea: mouseArea
2828 property real opacityOverride: 1
2929 property bool paused
30+ property bool skipped
3031 property bool isReady
3132
3233 signal finished()