on xenial help sign in
Add right edge tutorial
adc82d2Michael Terry
qml/Greeter/Greeter.qml+10−7
@@ -160,6 +160,14 @@ Showable {
160 return false;
160 return false;
161 }
161 }
162 }
162 }
163+
164+ function checkForcedUnlock() {
165+ if (forcedUnlock && shown) {
166+ // pretend we were just authenticated
167+ loader.item.hide();
168+ loader.item.notifyAuthenticationSucceeded();
169+ }
170+ }
163 }
171 }
164
172
165 onLauncherOffsetChanged: {
173 onLauncherOffsetChanged: {
@@ -168,13 +176,8 @@ Showable {
168 }
176 }
169 }
177 }
170
178
171− onForcedUnlockChanged: {
179+ onForcedUnlockChanged: d.checkForcedUnlock()
172− if (forcedUnlock && shown) {
180+ Component.onCompleted: d.checkForcedUnlock()
173− // pretend we were just authenticated
174− loader.item.hide();
175− loader.item.notifyAuthenticationSucceeded();
176− }
177− }
178
181
179 onRequiredChanged: {
182 onRequiredChanged: {
180 if (required) {
183 if (required) {
qml/Shell.qml+23−22
@@ -369,28 +369,6 @@ Item {
369 value: physicalKeysMapper.altTabPressed
369 value: physicalKeysMapper.altTabPressed
370 }
370 }
371 }
371 }
372−
373− Tutorial {
374− id: tutorial
375− objectName: "tutorial"
376− anchors.fill: parent
377−
378− // EdgeDragAreas don't work with mice. So to avoid trapping the user,
379− // we skip the tutorial on the Desktop to avoid using them. The
380− // Desktop doesn't use the same spread design anyway. The tutorial is
381− // all a bit of a placeholder on non-phone form factors right now.
382− // When the design team gives us more guidance, we can do something
383− // more clever here.
384− active: usageScenario != "desktop" && AccountsService.demoEdges
385−
386− launcher: launcher
387− panel: panel
388−
389− onFinished: {
390− AccountsService.demoEdges = false;
391− active = false; // for immediate response / if AS is having problems
392− }
393− }
394 }
372 }
395
373
396 InputMethod {
374 InputMethod {
@@ -600,6 +578,29 @@ Item {
600 }
578 }
601 }
579 }
602
580
581+ Tutorial {
582+ id: tutorial
583+ objectName: "tutorial"
584+ anchors.fill: parent
585+
586+ // EdgeDragAreas don't work with mice. So to avoid trapping the user,
587+ // we skip the tutorial on the Desktop to avoid using them. The
588+ // Desktop doesn't use the same spread design anyway. The tutorial is
589+ // all a bit of a placeholder on non-phone form factors right now.
590+ // When the design team gives us more guidance, we can do something
591+ // more clever here.
592+ active: usageScenario != "desktop" && AccountsService.demoEdges
593+
594+ launcher: launcher
595+ panel: panel
596+ stage: applicationsDisplayLoader.item
597+
598+ onFinished: {
599+ AccountsService.demoEdges = false;
600+ active = false; // for immediate response / if AS is having problems
601+ }
602+ }
603+
603 Wizard {
604 Wizard {
604 id: wizard
605 id: wizard
605 objectName: "wizard"
606 objectName: "wizard"
qml/Stages/PhoneStage.qml+1−1
@@ -101,7 +101,7 @@ Rectangle {
101 && spreadView.phase === 0
101 && spreadView.phase === 0
102
102
103 // How far left the stage has been dragged
103 // How far left the stage has been dragged
104− readonly property real dragProgress: spreadRepeater.count > 0 ? -spreadRepeater.itemAt(0).xTranslate : 0
104+ readonly property real dragProgress: spreadRepeater.count > 0 ? spreadRepeater.itemAt(0).progress : 0
105
105
106 readonly property alias dragging: spreadDragArea.dragging
106 readonly property alias dragging: spreadDragArea.dragging
107
107
qml/Stages/TabletStage.qml+3
@@ -86,6 +86,9 @@ Rectangle {
86 }
86 }
87 }
87 }
88
88
89+ // How far left the stage has been dragged
90+ readonly property real dragProgress: spreadRepeater.count > 0 ? spreadRepeater.itemAt(0).progress : 0
91+
89 // To be read from outside
92 // To be read from outside
90 property var mainApp: null
93 property var mainApp: null
91 property int mainAppWindowOrientationAngle: 0
94 property int mainAppWindowOrientationAngle: 0
qml/Tutorial/Tutorial.qml+7
@@ -24,6 +24,7 @@ Item {
24
24
25 property Item launcher
25 property Item launcher
26 property Item panel
26 property Item panel
27+ property Item stage
27
28
28 readonly property bool launcherEnabled: loader.item ? loader.item.launcherEnabled : true
29 readonly property bool launcherEnabled: loader.item ? loader.item.launcherEnabled : true
29 readonly property bool spreadEnabled: loader.item ? loader.item.spreadEnabled : true
30 readonly property bool spreadEnabled: loader.item ? loader.item.spreadEnabled : true
@@ -56,6 +57,12 @@ Item {
56 value: root.panel
57 value: root.panel
57 }
58 }
58
59
60+ Binding {
61+ target: loader.item
62+ property: "stage"
63+ value: root.stage
64+ }
65+
59 Connections {
66 Connections {
60 target: loader.item
67 target: loader.item
61 onFinished: root.finished()
68 onFinished: root.finished()
qml/Tutorial/TutorialContent.qml+33−4
@@ -23,9 +23,10 @@ Item {
23
23
24 property Item launcher
24 property Item launcher
25 property Item panel
25 property Item panel
26+ property Item stage
26
27
27 readonly property bool launcherEnabled: !running || tutorialLeft.shown
28 readonly property bool launcherEnabled: !running || tutorialLeft.shown
28− readonly property bool spreadEnabled: !running
29+ readonly property bool spreadEnabled: !running || tutorialRight.shown
29 readonly property bool panelEnabled: !running || tutorialTop.shown
30 readonly property bool panelEnabled: !running || tutorialTop.shown
30 readonly property bool panelContentEnabled: !running
31 readonly property bool panelContentEnabled: !running
31 readonly property alias running: d.running
32 readonly property alias running: d.running
@@ -41,15 +42,15 @@ Item {
41 QtObject {
42 QtObject {
42 id: d
43 id: d
43
44
44− property bool running: tutorialLeft.shown || tutorialTop.shown
45+ property bool running: tutorialLeft.shown || tutorialTop.shown || tutorialRight.shown
45 }
46 }
46
47
47 TutorialLeft {
48 TutorialLeft {
48 id: tutorialLeft
49 id: tutorialLeft
49 objectName: "tutorialLeft"
50 objectName: "tutorialLeft"
50− parent: root.panel
51 anchors.fill: parent
51 anchors.fill: parent
52 launcher: root.launcher
52 launcher: root.launcher
53+ hides: [launcher, panel.indicators]
53
54
54 Component.onCompleted: {
55 Component.onCompleted: {
55 if (AccountsService.demoEdgesCompleted.indexOf("left") == -1) {
56 if (AccountsService.demoEdgesCompleted.indexOf("left") == -1) {
@@ -65,9 +66,9 @@ Item {
65 TutorialTop {
66 TutorialTop {
66 id: tutorialTop
67 id: tutorialTop
67 objectName: "tutorialTop"
68 objectName: "tutorialTop"
68− parent: root.panel
69 anchors.fill: parent
69 anchors.fill: parent
70 panel: root.panel
70 panel: root.panel
71+ hides: [launcher, panel.indicators]
71
72
72 Connections {
73 Connections {
73 target: AccountsService
74 target: AccountsService
@@ -87,6 +88,34 @@ Item {
87
88
88 onFinished: {
89 onFinished: {
89 AccountsService.markDemoEdgeCompleted("top");
90 AccountsService.markDemoEdgeCompleted("top");
91+ }
92+ }
93+
94+ TutorialRight {
95+ id: tutorialRight
96+ objectName: "tutorialRight"
97+ anchors.fill: parent
98+ stage: root.stage
99+ hides: [launcher, panel.indicators]
100+
101+ Connections {
102+ target: AccountsService
103+ onDemoEdgesCompletedChanged: {
104+ if (AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
105+ AccountsService.demoEdgesCompleted.indexOf("right") == -1) {
106+ tutorialRightTimer.start();
107+ }
108+ }
109+ }
110+
111+ Timer {
112+ id: tutorialRightTimer
113+ interval: 1
114+ onTriggered: tutorialRight.show()
115+ }
116+
117+ onFinished: {
118+ AccountsService.markDemoEdgeCompleted("right");
90 root.finish();
119 root.finish();
91 }
120 }
92 }
121 }
qml/Tutorial/TutorialLeft.qml+4−8
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2014,2015 Canonical, Ltd.
2+ * Copyright (C) 2015 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU General Public License as published by
@@ -23,14 +23,10 @@ TutorialPage {
23
23
24 property var launcher
24 property var launcher
25
25
26− Connections {
26+ opacityOverride: 1 - launcher.visibleWidth / launcher.panelWidth
27− target: root.launcher
28
27
29− onStateChanged: {
28+ mouseArea {
30− if (root.launcher.state === "visible") {
29+ anchors.leftMargin: launcher.dragAreaWidth
31− root.hide();
32− }
33− }
34 }
30 }
35
31
36 background {
32 background {
qml/Tutorial/TutorialPage.qml+2−1
@@ -33,8 +33,9 @@ Showable {
33
33
34 visible: false
34 visible: false
35 shown: false
35 shown: false
36− opacity: Math.min(_showOpacity, opacityOverride)
37
36
37+ opacity: Math.min(_showOpacity, opacityOverride)
38+ onOpacityOverrideChanged: if (opacityOverride <= 0) hide()
38 property real _showOpacity: 0
39 property real _showOpacity: 0
39
40
40 showAnimation: StandardAnimation {
41 showAnimation: StandardAnimation {
qml/Tutorial/TutorialRight.qmlnew file+53
@@ -0,0 +1,53 @@
1+/*
2+ * Copyright (C) 2015 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 stage
25+
26+ opacityOverride: 1 - stage.dragProgress * 2
27+
28+ mouseArea {
29+ anchors.rightMargin: stage.dragAreaWidth
30+ }
31+
32+ background {
33+ sourceSize.height: 1080
34+ sourceSize.width: 1916
35+ source: Qt.resolvedUrl("graphics/background1.png")
36+ }
37+
38+ arrow {
39+ anchors.right: root.right
40+ anchors.rightMargin: units.gu(2)
41+ anchors.verticalCenter: root.verticalCenter
42+ rotation: 180
43+ }
44+
45+ label {
46+ text: i18n.tr("Short or long swipe from the right edge to view your open apps")
47+ anchors.right: arrow.left
48+ anchors.rightMargin: units.gu(3)
49+ anchors.left: root.left
50+ anchors.leftMargin: units.gu(4)
51+ anchors.verticalCenter: arrow.verticalCenter
52+ }
53+}
qml/Tutorial/TutorialTop.qml+1−2
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2014,2015 Canonical, Ltd.
2+ * Copyright (C) 2015 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU General Public License as published by
@@ -24,7 +24,6 @@ TutorialPage {
24 property var panel
24 property var panel
25
25
26 opacityOverride: 1 - panel.indicators.unitProgress
26 opacityOverride: 1 - panel.indicators.unitProgress
27− onOpacityOverrideChanged: if (opacityOverride === 0) hide()
28
27
29 mouseArea {
28 mouseArea {
30 anchors.topMargin: panel.indicators.minimizedPanelHeight
29 anchors.topMargin: panel.indicators.minimizedPanelHeight