on xenial help sign in
Rough first pass on spacing out screens
commit04efc3a35ef12a53e71b3c7daaaf0d299afb5541 authorMichael Terry <michael.terry@canonical.com> dateWed 30 Sep 2015, 14:47 (11 years ago) parentdf9c576
2 files changed+73−43
qml/Tutorial/Tutorial.qml−5 qml/Tutorial/TutorialContent.qml+73−38
qml/Tutorial/Tutorial.qml−5
@@ -44,11 +44,6 @@ Item {
4444 }
4545 }
4646
47− Connections {
48− target: panel.indicators
49− onFullyOpenedChanged: AccountsService.markDemoEdgeCompleted("top")
50− }
51−
5247 Loader {
5348 id: loader
5449 anchors.fill: parent
qml/Tutorial/TutorialContent.qml+73−38
@@ -17,6 +17,7 @@
1717import QtQuick 2.4
1818import Ubuntu.Components 1.3
1919import AccountsService 0.1
20+import Unity.Application 0.1
2021
2122Item {
2223 id: root
@@ -51,15 +52,14 @@ Item {
5152 launcher: root.launcher
5253 hides: [launcher, panel.indicators]
5354
54− Component.onCompleted: {
55+ function showIfReady() {
5556 if (AccountsService.demoEdgesCompleted.indexOf("left") == -1) {
5657 show();
5758 }
5859 }
5960
60− onFinished: {
61− AccountsService.markDemoEdgeCompleted("left");
62− }
61+ Component.onCompleted: showIfReady()
62+ onFinished: AccountsService.markDemoEdgeCompleted("left")
6363 }
6464
6565 TutorialTop {
@@ -69,24 +69,32 @@ Item {
6969 panel: root.panel
7070 hides: [launcher, panel.indicators]
7171
72− Connections {
73− target: AccountsService
74− onDemoEdgesCompletedChanged: {
75− if (AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
76− AccountsService.demoEdgesCompleted.indexOf("top") == -1) {
77− tutorialTopTimer.start();
78− }
79− }
72+ function isReady() {
73+ return AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
74+ AccountsService.demoEdgesCompleted.indexOf("top") == -1;
8075 }
8176
8277 Timer {
8378 id: tutorialTopTimer
84− interval: 1
85− onTriggered: tutorialTop.show()
79+ interval: 60000
80+ onTriggered: if (isReady()) tutorialTop.show()
8681 }
8782
88− onFinished: {
89− AccountsService.markDemoEdgeCompleted("top");
83+ Connections {
84+ target: AccountsService
85+ onDemoEdgesCompletedChanged: if (isReady()) tutorialTopTimer.start()
86+ }
87+
88+ Component.onCompleted: if (isReady()) tutorialTopTimer.start()
89+ onFinished: AccountsService.markDemoEdgeCompleted("top")
90+
91+ Connections {
92+ target: panel.indicators
93+ onFullyOpenedChanged: {
94+ if (panel.indicators.fullyOpened) {
95+ AccountsService.markDemoEdgeCompleted("top");
96+ }
97+ }
9098 }
9199 }
92100
@@ -97,24 +105,38 @@ Item {
97105 stage: root.stage
98106 hides: [launcher, panel.indicators]
99107
100− Connections {
101− target: AccountsService
102− onDemoEdgesCompletedChanged: {
103− if (AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
104− AccountsService.demoEdgesCompleted.indexOf("right") == -1) {
105− tutorialRightTimer.start();
106− }
107− }
108+ function isReady() {
109+ return AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
110+ AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
111+ AccountsService.demoEdgesCompleted.indexOf("right") == -1 &&
112+ ApplicationManager.count >= 3;
108113 }
109114
110115 Timer {
111116 id: tutorialRightTimer
112− interval: 1
113− onTriggered: tutorialRight.show()
117+ interval: 3000
118+ onTriggered: if (isReady()) tutorialRight.show()
114119 }
115120
116− onFinished: {
117− AccountsService.markDemoEdgeCompleted("right");
121+ Connections {
122+ target: AccountsService
123+ onDemoEdgesCompletedChanged: if (isReady()) tutorialRightTimer.start()
124+ }
125+
126+ Connections {
127+ target: ApplicationManager
128+ onApplicationAdded: if (isReady()) tutorialRight.show()
129+ }
130+
131+ onFinished: AccountsService.markDemoEdgeCompleted("right")
132+
133+ Connections {
134+ target: stage
135+ onDragProgressChanged: {
136+ if (stage.dragProgress >= 0.1) {
137+ AccountsService.markDemoEdgeCompleted("right");
138+ }
139+ }
118140 }
119141 }
120142
@@ -124,20 +146,33 @@ Item {
124146 anchors.fill: parent
125147 hides: [launcher, panel.indicators]
126148
127− Connections {
128− target: AccountsService
129− onDemoEdgesCompletedChanged: {
130− if (AccountsService.demoEdgesCompleted.indexOf("right") != -1 &&
131− AccountsService.demoEdgesCompleted.indexOf("bottom") == -1) {
132− tutorialBottomTimer.start();
133− }
134− }
149+ function isReady() {
150+ return AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
151+ AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
152+ AccountsService.demoEdgesCompleted.indexOf("right") != -1 &&
153+ AccountsService.demoEdgesCompleted.indexOf("bottom") == -1 &&
154+ // focused app is an app known to have a bottom edge
155+ (ApplicationManager.focusedApplicationId == "dialer-app" ||
156+ ApplicationManager.focusedApplicationId == "webbrowser-app" ||
157+ ApplicationManager.focusedApplicationId == "messaging-app" ||
158+ ApplicationManager.focusedApplicationId == "camera-app" ||
159+ ApplicationManager.focusedApplicationId == "clock-app");
135160 }
136161
137162 Timer {
138163 id: tutorialBottomTimer
139− interval: 1
140− onTriggered: tutorialBottom.show()
164+ interval: 3000
165+ onTriggered: if (isReady()) tutorialBottom.show()
166+ }
167+
168+ Connections {
169+ target: AccountsService
170+ onDemoEdgesCompletedChanged: if (isReady()) tutorialBottomTimer.start()
171+ }
172+
173+ Connections {
174+ target: ApplicationManager
175+ onFocusedApplicationIdChanged: if (isReady()) tutorialBottom.show()
141176 }
142177
143178 onFinished: {