on xenial help sign in
hide screen on long press not click; minor fixes for now
commit4c306d9e8f3e10ab21933ddb0780cea3f48e83ab authorMichael Terry <michael.terry@canonical.com> dateFri 2 Oct 2015, 13:30 (11 years ago) parentb410d9d
3 files changed+20−24
qml/Tutorial/TutorialBottom.qml+3−2 qml/Tutorial/TutorialContent.qml+16−21 qml/Tutorial/TutorialPage.qml+1−1
qml/Tutorial/TutorialBottom.qml+3−2
@@ -16,6 +16,7 @@
1616
1717import QtQuick 2.4
1818import Ubuntu.Components 1.3
19+import Ubuntu.Gestures 0.1
1920import "." as LocalComponents
2021
2122TutorialPage {
@@ -44,11 +45,11 @@ TutorialPage {
4445 width: root.width - units.gu(8)
4546 }
4647
47− DirectionalDragArea {
48+ /*DirectionalDragArea {
4849 direction: Direction.Upwards
4950 anchors.left: parent.left
5051 anchors.right: parent.right
5152 anchors.bottom: parent.bottom
5253 height: units.gu(1)
53− }
54+ }*/
5455}
qml/Tutorial/TutorialContent.qml+16−21
@@ -29,7 +29,10 @@ Item {
2929 readonly property bool launcherEnabled: !running || tutorialLeft.shown
3030 readonly property bool spreadEnabled: !running || tutorialRight.shown
3131 readonly property bool panelEnabled: !running || tutorialTop.shown
32− readonly property alias running: d.running
32+ readonly property alias running: tutorialLeft.shown
33+ || tutorialTop.shown
34+ || tutorialRight.shown
35+ || tutorialBottom.shown
3336
3437 signal finished()
3538
@@ -39,12 +42,6 @@ Item {
3942
4043 ////
4144
42− QtObject {
43− id: d
44−
45− property bool running: tutorialLeft.shown || tutorialTop.shown || tutorialRight.shown || tutorialBottom.shown
46− }
47−
4845 TutorialLeft {
4946 id: tutorialLeft
5047 objectName: "tutorialLeft"
@@ -52,13 +49,11 @@ Item {
5249 launcher: root.launcher
5350 hides: [launcher, panel.indicators]
5451
55− function showIfReady() {
56− if (AccountsService.demoEdgesCompleted.indexOf("left") == -1) {
57− show();
58− }
52+ function isReady() {
53+ return AccountsService.demoEdgesCompleted.indexOf("left") == -1;
5954 }
6055
61− Component.onCompleted: showIfReady()
56+ Component.onCompleted: if (parent.isReady()) show()
6257 onFinished: AccountsService.markDemoEdgeCompleted("left")
6358 }
6459
@@ -77,15 +72,15 @@ Item {
7772 Timer {
7873 id: tutorialTopTimer
7974 interval: 60000
80− onTriggered: if (isReady()) tutorialTop.show()
75+ onTriggered: if (parent.isReady()) tutorialTop.show()
8176 }
8277
8378 Connections {
8479 target: AccountsService
85− onDemoEdgesCompletedChanged: if (isReady()) tutorialTopTimer.start()
80+ onDemoEdgesCompletedChanged: if (parent.isReady()) tutorialTopTimer.start()
8681 }
8782
88− Component.onCompleted: if (isReady()) tutorialTopTimer.start()
83+ Component.onCompleted: if (parent.isReady()) tutorialTopTimer.start()
8984 onFinished: AccountsService.markDemoEdgeCompleted("top")
9085
9186 Connections {
@@ -115,17 +110,17 @@ Item {
115110 Timer {
116111 id: tutorialRightTimer
117112 interval: 3000
118− onTriggered: if (isReady()) tutorialRight.show()
113+ onTriggered: if (parent.isReady()) tutorialRight.show()
119114 }
120115
121116 Connections {
122117 target: AccountsService
123− onDemoEdgesCompletedChanged: if (isReady()) tutorialRightTimer.start()
118+ onDemoEdgesCompletedChanged: if (parent.isReady()) tutorialRightTimer.start()
124119 }
125120
126121 Connections {
127122 target: ApplicationManager
128− onApplicationAdded: if (isReady()) tutorialRight.show()
123+ onApplicationAdded: if (parent.isReady()) tutorialRight.show()
129124 }
130125
131126 onFinished: AccountsService.markDemoEdgeCompleted("right")
@@ -162,17 +157,17 @@ Item {
162157 Timer {
163158 id: tutorialBottomTimer
164159 interval: 3000
165− onTriggered: if (isReady()) tutorialBottom.show()
160+ onTriggered: if (parent.isReady()) tutorialBottom.show()
166161 }
167162
168163 Connections {
169164 target: AccountsService
170− onDemoEdgesCompletedChanged: if (isReady()) tutorialBottomTimer.start()
165+ onDemoEdgesCompletedChanged: if (parent.isReady()) tutorialBottomTimer.start()
171166 }
172167
173168 Connections {
174169 target: ApplicationManager
175− onFocusedApplicationIdChanged: if (isReady()) tutorialBottom.show()
170+ onFocusedApplicationIdChanged: if (parent.isReady()) tutorialBottom.show()
176171 }
177172
178173 onFinished: {
qml/Tutorial/TutorialPage.qml+1−1
@@ -59,7 +59,7 @@ Showable {
5959 MouseArea { // eat any errant presses
6060 id: mouseArea
6161 anchors.fill: parent
62− onClicked: root.hide()
62+ onPressAndHold: root.hide()
6363 }
6464
6565 Image {