on xenial help sign in
Rough first pass on spacing out screens
04efc3aMichael Terry
qml/Tutorial/Tutorial.qml−5
@@ -44,11 +44,6 @@ Item {
44 }
44 }
45 }
45 }
46
46
47− Connections {
48− target: panel.indicators
49− onFullyOpenedChanged: AccountsService.markDemoEdgeCompleted("top")
50− }
51−
52 Loader {
47 Loader {
53 id: loader
48 id: loader
54 anchors.fill: parent
49 anchors.fill: parent
qml/Tutorial/TutorialContent.qml+73−38
@@ -17,6 +17,7 @@
17import QtQuick 2.4
17import QtQuick 2.4
18import Ubuntu.Components 1.3
18import Ubuntu.Components 1.3
19import AccountsService 0.1
19import AccountsService 0.1
20+import Unity.Application 0.1
20
21
21Item {
22Item {
22 id: root
23 id: root
@@ -51,15 +52,14 @@ Item {
51 launcher: root.launcher
52 launcher: root.launcher
52 hides: [launcher, panel.indicators]
53 hides: [launcher, panel.indicators]
53
54
54− Component.onCompleted: {
55+ function showIfReady() {
55 if (AccountsService.demoEdgesCompleted.indexOf("left") == -1) {
56 if (AccountsService.demoEdgesCompleted.indexOf("left") == -1) {
56 show();
57 show();
57 }
58 }
58 }
59 }
59
60
60− onFinished: {
61+ Component.onCompleted: showIfReady()
61− AccountsService.markDemoEdgeCompleted("left");
62+ onFinished: AccountsService.markDemoEdgeCompleted("left")
62− }
63 }
63 }
64
64
65 TutorialTop {
65 TutorialTop {
@@ -69,24 +69,32 @@ Item {
69 panel: root.panel
69 panel: root.panel
70 hides: [launcher, panel.indicators]
70 hides: [launcher, panel.indicators]
71
71
72− Connections {
72+ function isReady() {
73− target: AccountsService
74− onDemoEdgesCompletedChanged: {
75− if (AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
73+ return AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
76− AccountsService.demoEdgesCompleted.indexOf("top") == -1) {
74+ AccountsService.demoEdgesCompleted.indexOf("top") == -1;
77− tutorialTopTimer.start();
78− }
79− }
80 }
75 }
81
76
82 Timer {
77 Timer {
83 id: tutorialTopTimer
78 id: tutorialTopTimer
84− interval: 1
79+ interval: 60000
85− onTriggered: tutorialTop.show()
80+ onTriggered: if (isReady()) tutorialTop.show()
86 }
81 }
87
82
88− onFinished: {
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) {
89− AccountsService.markDemoEdgeCompleted("top");
95+ AccountsService.markDemoEdgeCompleted("top");
96+ }
97+ }
90 }
98 }
91 }
99 }
92
100
@@ -97,24 +105,38 @@ Item {
97 stage: root.stage
105 stage: root.stage
98 hides: [launcher, panel.indicators]
106 hides: [launcher, panel.indicators]
99
107
100− Connections {
108+ function isReady() {
101− target: AccountsService
109+ return AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
102− onDemoEdgesCompletedChanged: {
103− if (AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
110+ AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
104− AccountsService.demoEdgesCompleted.indexOf("right") == -1) {
111+ AccountsService.demoEdgesCompleted.indexOf("right") == -1 &&
105− tutorialRightTimer.start();
112+ ApplicationManager.count >= 3;
106− }
107− }
108 }
113 }
109
114
110 Timer {
115 Timer {
111 id: tutorialRightTimer
116 id: tutorialRightTimer
112− interval: 1
117+ interval: 3000
113− onTriggered: tutorialRight.show()
118+ onTriggered: if (isReady()) tutorialRight.show()
114 }
119 }
115
120
116− onFinished: {
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) {
117− AccountsService.markDemoEdgeCompleted("right");
137+ AccountsService.markDemoEdgeCompleted("right");
138+ }
139+ }
118 }
140 }
119 }
141 }
120
142
@@ -124,20 +146,33 @@ Item {
124 anchors.fill: parent
146 anchors.fill: parent
125 hides: [launcher, panel.indicators]
147 hides: [launcher, panel.indicators]
126
148
127− Connections {
149+ function isReady() {
128− target: AccountsService
150+ return AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
129− onDemoEdgesCompletedChanged: {
151+ AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
130− if (AccountsService.demoEdgesCompleted.indexOf("right") != -1 &&
152+ AccountsService.demoEdgesCompleted.indexOf("right") != -1 &&
131− AccountsService.demoEdgesCompleted.indexOf("bottom") == -1) {
153+ AccountsService.demoEdgesCompleted.indexOf("bottom") == -1 &&
132− tutorialBottomTimer.start();
154+ // focused app is an app known to have a bottom edge
133− }
155+ (ApplicationManager.focusedApplicationId == "dialer-app" ||
134− }
156+ ApplicationManager.focusedApplicationId == "webbrowser-app" ||
157+ ApplicationManager.focusedApplicationId == "messaging-app" ||
158+ ApplicationManager.focusedApplicationId == "camera-app" ||
159+ ApplicationManager.focusedApplicationId == "clock-app");
135 }
160 }
136
161
137 Timer {
162 Timer {
138 id: tutorialBottomTimer
163 id: tutorialBottomTimer
139− interval: 1
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
140− onTriggered: tutorialBottom.show()
175+ onFocusedApplicationIdChanged: if (isReady()) tutorialBottom.show()
141 }
176 }
142
177
143 onFinished: {
178 onFinished: {