Merge lp:~unity-team/unity8/side-stage-redesign-tutorial into lp:unity8

Proposed by Michał Sawicz
Status: Work in progress
Proposed branch: lp:~unity-team/unity8/side-stage-redesign-tutorial
Merge into: lp:unity8
Prerequisite: lp:~unity-team/unity8/side-stage-redesign
Diff against target: 817 lines (+470/-45)
13 files modified
qml/Components/Showable.qml (+2/-2)
qml/Shell.qml (+2/-1)
qml/Stages/SideStage.qml (+2/-1)
qml/Stages/TabletSideStageTouchGesture.qml (+2/-0)
qml/Stages/TabletStage.qml (+25/-0)
qml/Tutorial/EdgesTutorial.qml (+8/-1)
qml/Tutorial/EdgesTutorialContent.qml (+7/-6)
qml/Tutorial/SideStageTutorial.qml (+63/-0)
qml/Tutorial/SideStageTutorialPage.qml (+250/-0)
qml/Tutorial/TutorialPage.qml (+8/-1)
tests/qmltests/Stages/tst_TabletStage.qml (+12/-0)
tests/qmltests/Tutorial/tst_Tutorial.qml (+74/-32)
tests/qmltests/tst_Shell.qml (+15/-1)
To merge this branch: bzr merge lp:~unity-team/unity8/side-stage-redesign-tutorial
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing
Unity Team Pending
PS Jenkins bot continuous-integration Pending
Review via email: mp+288833@code.launchpad.net

This proposal supersedes a proposal from 2016-01-04.

Commit message

Added progressive discovery tutorial for Side stage.
Renamed some of the tutorial pages.

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
https://code.launchpad.net/~nick-dedekind/unity8/side-stage-redesign/+merge/281522
https://code.launchpad.net/~nick-dedekind/qtmir/side-stage-redesign/+merge/279309
https://code.launchpad.net/~nick-dedekind/unity-api/side-stage-redesign/+merge/279308

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
Yes

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2040
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/107/
Executed test runs:

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/107/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2040
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/107/
Executed test runs:

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/107/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2040
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/107/
Executed test runs:

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/107/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Path conflict: <deleted> / qml/Tutorial/RightEdgeTutorialPage.qml
Path conflict: <deleted> / qml/Tutorial/LeftEdgeFinishTutorialPage.qml
Path conflict: <deleted> / qml/Tutorial/BottomEdgeFinishTutorialPage.qml
Path conflict: <deleted> / qml/Tutorial/BottomEdgeTutorialPage.qml
Text conflict in qml/Shell.qml
Text conflict in qml/Tutorial/EdgesTutorial.qml
Text conflict in qml/Tutorial/EdgesTutorialContent.qml
Text conflict in qml/Tutorial/TutorialPage.qml
Text conflict in tests/qmltests/Tutorial/tst_Tutorial.qml
Text conflict in tests/qmltests/tst_Shell.qml
10 conflicts encountered.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Has had conflcits for over a month, moving over to WiP to clear the queue a bit.

Unmerged revisions

2277. By Michał Sawicz

Added progressive discovery tutorial for Side stage.
Renamed some of the tutorial pages.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/Components/Showable.qml'
--- qml/Components/Showable.qml 2016-03-11 20:21:04 +0000
+++ qml/Components/Showable.qml 2016-03-11 20:21:06 +0000
@@ -39,8 +39,8 @@
3939
40 // automatically set the target on showAnimation and hideAnimation to be the40 // automatically set the target on showAnimation and hideAnimation to be the
41 // showable itself41 // showable itself
42 onShowAnimationChanged: if (showAnimation) showAnimation["target"] = showable42 onShowAnimationChanged: if (showAnimation && showAnimation.hasOwnProperty("target")) showAnimation["target"] = showable
43 onHideAnimationChanged: if (hideAnimation) hideAnimation["target"] = showable43 onHideAnimationChanged: if (hideAnimation && hideAnimation.hasOwnProperty("target")) hideAnimation["target"] = showable
4444
45 Component.onCompleted: required = shown;45 Component.onCompleted: required = shown;
4646
4747
=== modified file 'qml/Shell.qml'
--- qml/Shell.qml 2016-03-11 20:21:04 +0000
+++ qml/Shell.qml 2016-03-11 20:21:06 +0000
@@ -354,10 +354,11 @@
354 }354 }
355 }355 }
356356
357 Tutorial {357 EdgesTutorial {
358 id: tutorial358 id: tutorial
359 objectName: "tutorial"359 objectName: "tutorial"
360 anchors.fill: parent360 anchors.fill: parent
361 usageScenario: shell.usageScenario
361362
362 // EdgeDragAreas don't work with mice. So to avoid trapping the user,363 // EdgeDragAreas don't work with mice. So to avoid trapping the user,
363 // we skip the tutorial on the Desktop to avoid using them. The364 // we skip the tutorial on the Desktop to avoid using them. The
364365
=== modified file 'qml/Stages/SideStage.qml'
--- qml/Stages/SideStage.qml 2016-03-11 20:21:04 +0000
+++ qml/Stages/SideStage.qml 2016-03-11 20:21:06 +0000
@@ -26,6 +26,7 @@
26 property int panelWidth: units.gu(40)26 property int panelWidth: units.gu(40)
27 readonly property alias dragging: hideSideStageDragArea.dragging27 readonly property alias dragging: hideSideStageDragArea.dragging
28 readonly property real progress: width / panelWidth28 readonly property real progress: width / panelWidth
29 property bool enableDrag: true
2930
30 width: 031 width: 0
31 shown: false32 shown: false
@@ -100,7 +101,7 @@
100101
101 direction: Direction.Leftwards102 direction: Direction.Leftwards
102 rotation: 180103 rotation: 180
103 enabled: root.shown104 enabled: root.shown && enableDrag
104 anchors.right: root.left105 anchors.right: root.left
105 width: sideStageDragHandle.width106 width: sideStageDragHandle.width
106 height: root.height107 height: root.height
107108
=== modified file 'qml/Stages/TabletSideStageTouchGesture.qml'
--- qml/Stages/TabletSideStageTouchGesture.qml 2016-03-11 20:21:04 +0000
+++ qml/Stages/TabletSideStageTouchGesture.qml 2016-03-11 20:21:06 +0000
@@ -106,6 +106,8 @@
106 }106 }
107107
108 onDragStarted: {108 onDragStarted: {
109 if (!dragComponent) return;
110
109 if (dragComponentProperties) {111 if (dragComponentProperties) {
110 priv.dragObject = dragComponent.createObject(root, dragComponentProperties);112 priv.dragObject = dragComponent.createObject(root, dragComponentProperties);
111 } else {113 } else {
112114
=== modified file 'qml/Stages/TabletStage.qml'
--- qml/Stages/TabletStage.qml 2016-03-11 20:21:04 +0000
+++ qml/Stages/TabletStage.qml 2016-03-11 20:21:06 +0000
@@ -18,9 +18,11 @@
18import Ubuntu.Components 1.318import Ubuntu.Components 1.3
19import Ubuntu.Gestures 0.119import Ubuntu.Gestures 0.1
20import Unity.Application 0.120import Unity.Application 0.1
21import AccountsService 0.1
21import Utils 0.122import Utils 0.1
22import Powerd 0.123import Powerd 0.1
23import "../Components"24import "../Components"
25import "../Tutorial"
2426
25AbstractStage {27AbstractStage {
26 id: root28 id: root
@@ -603,6 +605,7 @@
603 objectName: "sideStage"605 objectName: "sideStage"
604 height: priv.landscapeHeight606 height: priv.landscapeHeight
605 x: spreadView.width - width607 x: spreadView.width - width
608 showHint: !priv.sideStageAppId
606 z: {609 z: {
607 if (!priv.mainStageAppId) return 0;610 if (!priv.mainStageAppId) return 0;
608611
@@ -1101,4 +1104,26 @@
1101 }1104 }
1102 }1105 }
1103 }1106 }
1107
1108 Loader {
1109 id: sideStageTutorialLoader
1110 anchors.fill: parent
1111
1112 property bool doSideStageDemo: false
1113 Component.onCompleted: doSideStageDemo = AccountsService.demoEdges
1114 Connections {
1115 target: AccountsService
1116 onDemoEdgesChanged: {
1117 if (AccountsService.demoEdges) sideStageTutorialLoader.doSideStageDemo = true;
1118 }
1119 }
1120 active: doSideStageDemo && mainApp && (mainApp.supportedOrientations & (Qt.PortraitOrientation|Qt.InvertedPortraitOrientation))
1121
1122 sourceComponent: SideStageTutorial {
1123 Component.onCompleted: sideStage.hide();
1124 onFinished: {
1125 sideStageTutorialLoader.doSideStageDemo = false;
1126 }
1127 }
1128 }
1104}1129}
11051130
=== renamed file 'qml/Tutorial/TutorialBottomFinish.qml' => 'qml/Tutorial/BottomEdgeFinishTutorialPage.qml'
=== renamed file 'qml/Tutorial/TutorialBottom.qml' => 'qml/Tutorial/BottomEdgeTutorialPage.qml'
=== renamed file 'qml/Tutorial/Tutorial.qml' => 'qml/Tutorial/EdgesTutorial.qml'
--- qml/Tutorial/Tutorial.qml 2015-08-25 07:25:26 +0000
+++ qml/Tutorial/EdgesTutorial.qml 2016-03-11 20:21:06 +0000
@@ -23,6 +23,7 @@
23 property alias active: loader.active23 property alias active: loader.active
24 property bool paused24 property bool paused
25 property real edgeSize25 property real edgeSize
26 property string usageScenario
2627
27 property Item launcher28 property Item launcher
28 property Item panel29 property Item panel
@@ -44,7 +45,7 @@
44 Loader {45 Loader {
45 id: loader46 id: loader
46 anchors.fill: parent47 anchors.fill: parent
47 source: "TutorialContent.qml"48 source: "EdgesTutorialContent.qml"
4849
49 Binding {50 Binding {
50 target: loader.item51 target: loader.item
@@ -70,6 +71,12 @@
70 value: root.panel71 value: root.panel
71 }72 }
7273
74 Binding {
75 target: loader.item
76 property: "usageScenario"
77 value: root.usageScenario
78 }
79
73 Connections {80 Connections {
74 target: loader.item81 target: loader.item
75 onFinished: root.finished()82 onFinished: root.finished()
7683
=== renamed file 'qml/Tutorial/TutorialContent.qml' => 'qml/Tutorial/EdgesTutorialContent.qml'
--- qml/Tutorial/TutorialContent.qml 2015-08-25 07:25:26 +0000
+++ qml/Tutorial/EdgesTutorialContent.qml 2016-03-11 20:21:06 +0000
@@ -22,6 +22,7 @@
2222
23 property Item launcher23 property Item launcher
24 property Item panel24 property Item panel
25 property string usageScenario
2526
26 readonly property bool launcherEnabled: !running ||27 readonly property bool launcherEnabled: !running ||
27 (!paused && tutorialLeft.shown)28 (!paused && tutorialLeft.shown)
@@ -61,7 +62,7 @@
61 }62 }
62 }63 }
6364
64 TutorialLeft {65 LeftEdgeTutorialPage {
65 id: tutorialLeft66 id: tutorialLeft
66 objectName: "tutorialLeft"67 objectName: "tutorialLeft"
67 anchors.fill: parent68 anchors.fill: parent
@@ -71,7 +72,7 @@
71 onFinished: tutorialLeftFinish.show()72 onFinished: tutorialLeftFinish.show()
72 }73 }
7374
74 TutorialLeftFinish {75 LeftEdgeFinishTutorialPage {
75 id: tutorialLeftFinish76 id: tutorialLeftFinish
76 objectName: "tutorialLeftFinish"77 objectName: "tutorialLeftFinish"
77 anchors.fill: parent78 anchors.fill: parent
@@ -85,7 +86,7 @@
85 }86 }
86 }87 }
8788
88 TutorialRight {89 RightEdgeTutorialPage {
89 id: tutorialRight90 id: tutorialRight
90 objectName: "tutorialRight"91 objectName: "tutorialRight"
91 anchors.fill: parent92 anchors.fill: parent
@@ -96,7 +97,7 @@
96 onFinished: tutorialBottom.show()97 onFinished: tutorialBottom.show()
97 }98 }
9899
99 TutorialBottom {100 BottomEdgeTutorialPage {
100 id: tutorialBottom101 id: tutorialBottom
101 objectName: "tutorialBottom"102 objectName: "tutorialBottom"
102 anchors.fill: parent103 anchors.fill: parent
@@ -106,11 +107,11 @@
106 onFinished: tutorialBottomFinish.show()107 onFinished: tutorialBottomFinish.show()
107 }108 }
108109
109 TutorialBottomFinish {110 BottomEdgeFinishTutorialPage {
110 id: tutorialBottomFinish111 id: tutorialBottomFinish
111 objectName: "tutorialBottomFinish"112 objectName: "tutorialBottomFinish"
112 anchors.fill: parent113 anchors.fill: parent
113 backgroundFadesOut: true114 backgroundFadesOut: usageScenario !== "tablet"
114 paused: !shown || root.paused115 paused: !shown || root.paused
115116
116 onFinished: root.finish()117 onFinished: root.finish()
117118
=== renamed file 'qml/Tutorial/TutorialLeftFinish.qml' => 'qml/Tutorial/LeftEdgeFinishTutorialPage.qml'
=== renamed file 'qml/Tutorial/TutorialLeft.qml' => 'qml/Tutorial/LeftEdgeTutorialPage.qml'
=== renamed file 'qml/Tutorial/TutorialRight.qml' => 'qml/Tutorial/RightEdgeTutorialPage.qml'
=== added file 'qml/Tutorial/SideStageTutorial.qml'
--- qml/Tutorial/SideStageTutorial.qml 1970-01-01 00:00:00 +0000
+++ qml/Tutorial/SideStageTutorial.qml 2016-03-11 20:21:06 +0000
@@ -0,0 +1,63 @@
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
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20Item {
21 id: root
22
23 property bool paused: false
24 readonly property alias running: d.running
25
26 Component.onCompleted: {
27 d.start();
28 }
29
30 signal finished()
31
32 function finish() {
33 d.stop();
34 finished();
35 }
36
37 QtObject {
38 id: d
39
40 property bool running
41
42 function stop() {
43 running = false;
44 }
45
46 function start() {
47 running = true;
48 tutorialSideStage.show();
49 }
50 }
51
52 SideStageTutorialPage {
53 id: tutorialSideStage
54 objectName: "tutorialSideStage"
55 backgroundFadesIn: true
56 backgroundFadesOut: true
57 anchors.fill: parent
58 paused: !shown || root.paused
59 panel: root.panel
60
61 onFinished: root.finish()
62 }
63}
064
=== added file 'qml/Tutorial/SideStageTutorialPage.qml'
--- qml/Tutorial/SideStageTutorialPage.qml 1970-01-01 00:00:00 +0000
+++ qml/Tutorial/SideStageTutorialPage.qml 2016-03-11 20:21:06 +0000
@@ -0,0 +1,250 @@
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
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import Ubuntu.Gestures 0.1
20import "../Components"
21import "../Stages"
22import "." as LocalComponents
23
24TutorialPage {
25 id: root
26
27 property var panel
28
29 title: i18n.tr("Open/Close side stage")
30 text: i18n.tr("3 finger tap the screen.")
31 fullTextWidth: true
32
33 SequentialAnimation {
34 id: teaseAnimation
35 paused: running && root.paused
36 running: true
37 loops: Animation.Infinite
38
39 property real scale: 1
40
41 UbuntuNumberAnimation {
42 target: teaseAnimation
43 property: "scale"
44 to: 0.95
45 duration: UbuntuAnimation.FastDuration
46 }
47 UbuntuNumberAnimation {
48 target: teaseAnimation
49 property: "scale"
50 to: 1
51 duration: UbuntuAnimation.SleepyDuration
52 }
53 }
54
55 Behavior on textYOffset { UbuntuNumberAnimation {} }
56
57 StateGroup {
58 id: internalState
59 states: [
60 State {
61 name: "initial"
62 StateChangeScript {
63 script: {
64 root.hideError();
65 overlayGesture.hide();
66 overlayFinish.hide();
67 sideStage.hide();
68 }
69 }
70 },
71 State {
72 name: "overlayGesture"
73 PropertyChanges {
74 target: root
75 title: i18n.tr("Load the sidestage")
76 text: i18n.tr("3 finger drag from one window to the other")
77 }
78 PropertyChanges { target: root; textYOffset: -units.gu(15); }
79 PropertyChanges { target: tapIcon; visible: false; }
80 StateChangeScript {
81 script: {
82 root.hideError();
83 overlayGesture.show();
84 sideStage.show();
85 }
86 }
87 },
88 State {
89 name: "overlayFinish"
90 PropertyChanges {
91 target: root
92 title: i18n.tr("This is the loaded side stage")
93 text: i18n.tr("Tap here to continue.")
94 }
95 PropertyChanges { target: tapIcon; visible: false; }
96 StateChangeScript {
97 script: {
98 root.hideError();
99 overlayFinish.show();
100 }
101 }
102 PropertyChanges { target: gestureArea; enabled: false }
103 }
104 ]
105 }
106
107 foreground {
108 children: [
109 Icon {
110 id: tapIcon
111 width: units.gu(20)
112 anchors.verticalCenter: parent.verticalCenter
113 anchors.left: parent.horizontalCenter
114 source: "../Stages/graphics/sidestage_open.svg"
115 scale: teaseAnimation.scale
116 },
117 SideStage {
118 id: sideStage
119 height: parent.height
120 x: parent.width - width
121 showHint: false
122 enableDrag: false
123
124 Icon {
125 name: "tick"
126 anchors.verticalCenter: parent.verticalCenter
127 x: Math.max(parent.width / 2 - width / 2, 0)
128 width: units.gu(8)
129 visible: overlayFinish.shown
130 }
131
132 DropArea {
133 anchors.fill: parent
134 onDropped: {
135 root.hideError();
136 internalState.state = "overlayFinish";
137 }
138 }
139 },
140 Showable {
141 id: overlayGesture
142 objectName: "overlayGesture"
143 anchors.fill: parent
144 hides: [ overlayFinish ]
145
146 opacity: 0
147 shown: false
148 showAnimation: SequentialAnimation {
149 PropertyAction { target: overlayGesture; property: "opacity"; value: 0 }
150 ParallelAnimation {
151 PropertyAction { target: overlayGesture; property: "visible"; value: true }
152 UbuntuNumberAnimation { target: overlayGesture; property: "opacity"; to: 1 }
153 }
154 }
155 Icon {
156 width: units.gu(40)
157 anchors.centerIn: parent
158 source: "../Stages/graphics/sidestage_drag.svg"
159 scale: teaseAnimation.scale
160 }
161 },
162 Showable {
163 id: overlayFinish
164 objectName: "overlayFinish"
165 anchors.fill: parent
166 hides: [ overlayGesture ]
167
168 opacity: 0
169 shown: false
170 showAnimation: SequentialAnimation {
171 PropertyAction { target: overlayFinish; property: "opacity"; value: 0 }
172 ParallelAnimation {
173 PropertyAction { target: overlayFinish; property: "visible"; value: true }
174 UbuntuNumberAnimation { target: overlayFinish; property: "opacity"; to: 1 }
175 }
176 }
177
178 LocalComponents.Tick {
179 objectName: "tickTap"
180 anchors {
181 left: parent.left
182 leftMargin: root.textLeft
183 top: parent.top
184 topMargin: root.textBottom + units.gu(3)
185 }
186 onClicked: root.hide()
187 }
188 },
189 Label {
190 anchors {
191 left: parent.left
192 leftMargin: root.textLeft
193 bottom: parent.bottom
194 bottomMargin: units.gu(3)
195 }
196
197 text: "Dismiss"
198 font.underline: true
199 fontSize: "medium"
200
201 MouseArea {
202 anchors {
203 fill: parent
204 margins: -units.gu(1)
205 }
206 onClicked: root.finished();
207 }
208 }
209
210 ]
211 }
212
213 TabletSideStageTouchGesture {
214 id: gestureArea
215 anchors {
216 left: parent.left
217 top: parent.top
218 bottom: parent.bottom
219 }
220 width: parent.width - sideStage.width
221
222 onClicked: {
223 root.hideError();
224 if (internalState.state !== "overlayGesture") {
225 internalState.state = "overlayGesture";
226 } else {
227 internalState.state = "initial";
228 }
229 }
230
231 dragComponent: overlayGesture.shown ? dragComponent : null
232 Component {
233 id: dragComponent
234 Icon {
235 width: units.gu(20)
236 source: "../Stages/graphics/sidestage_open.svg"
237 }
238 }
239
240 onDropped: {
241 // still in the gesture state after dropping?
242 if (!overlayFinish.shown) {
243 root.showError();
244 }
245 }
246 onCancelled: {
247 root.showError();
248 }
249 }
250}
0251
=== modified file 'qml/Tutorial/TutorialPage.qml'
--- qml/Tutorial/TutorialPage.qml 2015-07-15 15:07:19 +0000
+++ qml/Tutorial/TutorialPage.qml 2016-03-11 20:21:06 +0000
@@ -45,6 +45,9 @@
45 // The text label bottom, so you can position elements relative to it45 // The text label bottom, so you can position elements relative to it
46 readonly property real textBottom: Math.max(textLabel.y + textLabel.height, errorTextLabel.y + errorTextLabel.height)46 readonly property real textBottom: Math.max(textLabel.y + textLabel.height, errorTextLabel.y + errorTextLabel.height)
4747
48 // The text label bottom, so you can position elements relative to it
49 readonly property real textLeft: Math.max(textLabel.x, errorTextLabel.x)
50
48 // The MouseArea that eats events (so you can adjust size as you will)51 // The MouseArea that eats events (so you can adjust size as you will)
49 property alias mouseArea: mouseArea52 property alias mouseArea: mouseArea
5053
@@ -61,12 +64,16 @@
61 errorTimer.start();64 errorTimer.start();
62 }65 }
6366
67 function hideError() {
68 errorTimer.stop();
69 }
70
64 ////71 ////
6572
66 visible: false73 visible: false
67 shown: false74 shown: false
6875
69 property real _foregroundHideOpacity76 property real _foregroundHideOpacity: 1.0
7077
71 showAnimation: StandardAnimation {78 showAnimation: StandardAnimation {
72 property: root.backgroundFadesIn ? "opacity" : "_foregroundHideOpacity"79 property: root.backgroundFadesIn ? "opacity" : "_foregroundHideOpacity"
7380
=== modified file 'tests/qmltests/Stages/tst_TabletStage.qml'
--- tests/qmltests/Stages/tst_TabletStage.qml 2016-03-11 20:21:04 +0000
+++ tests/qmltests/Stages/tst_TabletStage.qml 2016-03-11 20:21:06 +0000
@@ -21,6 +21,7 @@
21import Unity.Application 0.121import Unity.Application 0.1
22import Unity.Test 0.122import Unity.Test 0.1
23import Utils 0.123import Utils 0.1
24import AccountsService 0.1
2425
25import ".."26import ".."
26import "../../../qml/Stages"27import "../../../qml/Stages"
@@ -34,6 +35,11 @@
3435
35 property var greeter: { fullyShown: true }36 property var greeter: { fullyShown: true }
3637
38 Component.onCompleted: {
39 theme.name = "Ubuntu.Components.Themes.SuruGradient"
40 tabletStageLoader.active = true;
41 }
42
37 Loader {43 Loader {
38 id: tabletStageLoader44 id: tabletStageLoader
3945
@@ -43,6 +49,7 @@
43 height: units.gu(100*0.7)49 height: units.gu(100*0.7)
4450
45 focus: true51 focus: true
52 active: false
4653
47 property bool itemDestroyed: false54 property bool itemDestroyed: false
48 sourceComponent: Component {55 sourceComponent: Component {
@@ -91,6 +98,11 @@
91 }98 }
9299
93 Button {100 Button {
101 text: "Show Tutorial"
102 onClicked: AccountsService.demoEdges = true
103 }
104
105 Button {
94 text: testCase.sideStage ? testCase.sideStage.shown ? "Hide Side-stage" : "Show Side-stage" : ""106 text: testCase.sideStage ? testCase.sideStage.shown ? "Hide Side-stage" : "Show Side-stage" : ""
95 enabled: testCase.sideStage107 enabled: testCase.sideStage
96 onClicked: {108 onClicked: {
97109
=== modified file 'tests/qmltests/Tutorial/tst_Tutorial.qml'
--- tests/qmltests/Tutorial/tst_Tutorial.qml 2015-09-02 07:42:27 +0000
+++ tests/qmltests/Tutorial/tst_Tutorial.qml 2016-03-11 20:21:06 +0000
@@ -19,31 +19,18 @@
19import AccountsService 0.119import AccountsService 0.1
20import IntegratedLightDM 0.1 as LightDM20import IntegratedLightDM 0.1 as LightDM
21import Ubuntu.Components 1.321import Ubuntu.Components 1.3
22import Ubuntu.Components.ListItems 1.3 as ListItem
22import Unity.Application 0.123import Unity.Application 0.1
23import Unity.Test 0.1 as UT24import Unity.Test 0.1 as UT
2425
25import "../../../qml"26import "../../../qml"
27import "../../../qml/Components"
2628
27Item {29Rectangle {
28 id: root30 id: root
29 width: shellLoader.width + buttons.width31 color: "grey"
30 height: shellLoader.height32 width: units.gu(100) + controlRect.width
3133 height: units.gu(71)
32 QtObject {
33 id: applicationArguments
34
35 function hasGeometry() {
36 return false;
37 }
38
39 function width() {
40 return 0;
41 }
42
43 function height() {
44 return 0;
45 }
46 }
4734
48 Component.onCompleted: {35 Component.onCompleted: {
49 // must set the mock mode before loading the Shell36 // must set the mock mode before loading the Shell
@@ -52,38 +39,86 @@
52 shellLoader.active = true;39 shellLoader.active = true;
53 }40 }
5441
55 Row {42 Item {
56 spacing: 043 id: shellContainer
57 anchors.fill: parent44 anchors.left: root.left
5845 anchors.right: controlRect.left
46 anchors.top: root.top
47 anchors.bottom: root.bottom
59 Loader {48 Loader {
60 id: shellLoader49 id: shellLoader
50 focus: true
51
52 anchors.centerIn: parent
53
54 property int shellOrientation: Qt.PortraitOrientation
55 property int nativeOrientation: Qt.PortraitOrientation
56 property int primaryOrientation: Qt.PortraitOrientation
57
58 state: usageScenarioSelector.model[usageScenarioSelector.selectedIndex]
59 states: [
60 State {
61 name: "phone"
62 PropertyChanges {
63 target: shellLoader
64 width: units.gu(40)
65 height: units.gu(71)
66 }
67 },
68 State {
69 name: "tablet"
70 PropertyChanges {
71 target: shellLoader
72 width: units.gu(100)
73 height: units.gu(71)
74 shellOrientation: Qt.LandscapeOrientation
75 nativeOrientation: Qt.LandscapeOrientation
76 primaryOrientation: Qt.LandscapeOrientation
77 }
78 }
79 ]
6180
62 active: false81 active: false
63 width: units.gu(40)
64 height: units.gu(71)
65
66 property bool itemDestroyed: false82 property bool itemDestroyed: false
67 sourceComponent: Component {83 sourceComponent: Component {
68 Shell {84 Shell {
85 id: __shell
69 property string indicatorProfile: "phone"86 property string indicatorProfile: "phone"
7087
88 usageScenario: shellLoader.state
89 nativeWidth: width
90 nativeHeight: height
71 Component.onDestruction: {91 Component.onDestruction: {
72 shellLoader.itemDestroyed = true;92 shellLoader.itemDestroyed = true;
73 }93 }
94 orientation: shellLoader.shellOrientation
95 orientations: Orientations {
96 native_: shellLoader.nativeOrientation
97 primary: shellLoader.primaryOrientation
98 }
74 }99 }
75 }100 }
76 }101 }
77102 }
78 Rectangle {103
79 id: buttons104 Rectangle {
80 color: "white"105 id: controlRect
81 width: units.gu(30)106 anchors.top: root.top
82 height: shellLoader.height107 anchors.bottom: root.bottom
108 anchors.right: root.right
109 width: units.gu(30)
110 color: "darkgrey"
111
112 Flickable {
113 id: controls
114 contentHeight: controlCol.height
115 anchors.fill: parent
83116
84 Column {117 Column {
118 id: controlCol
85 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }119 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
86 spacing: units.gu(1)120 spacing: units.gu(1)
121
87 Row {122 Row {
88 anchors { left: parent.left; right: parent.right }123 anchors { left: parent.left; right: parent.right }
89 Button {124 Button {
@@ -97,6 +132,13 @@
97 }132 }
98 }133 }
99 }134 }
135 ListItem.ItemSelector {
136 id: usageScenarioSelector
137 anchors { left: parent.left; right: parent.right }
138 activeFocusOnPress: false
139 text: "Usage scenario"
140 model: ["phone", "tablet"]
141 }
100 }142 }
101 }143 }
102 }144 }
103145
=== modified file 'tests/qmltests/tst_Shell.qml'
--- tests/qmltests/tst_Shell.qml 2016-03-11 20:21:04 +0000
+++ tests/qmltests/tst_Shell.qml 2016-03-11 20:21:06 +0000
@@ -141,11 +141,13 @@
141 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }141 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
142 spacing: units.gu(1)142 spacing: units.gu(1)
143143
144 Row {144 Column {
145 spacing: units.gu(1)145 spacing: units.gu(1)
146 anchors { left: parent.left; right: parent.right }
146 Button {147 Button {
147 text: "Show Greeter"148 text: "Show Greeter"
148 activeFocusOnPress: false149 activeFocusOnPress: false
150 anchors { left: parent.left; right: parent.right }
149 onClicked: {151 onClicked: {
150 if (shellLoader.status !== Loader.Ready)152 if (shellLoader.status !== Loader.Ready)
151 return;153 return;
@@ -159,6 +161,7 @@
159 Button {161 Button {
160 text: "Hide Greeter"162 text: "Hide Greeter"
161 activeFocusOnPress: false163 activeFocusOnPress: false
164 anchors { left: parent.left; right: parent.right }
162 onClicked: {165 onClicked: {
163 if (shellLoader.status !== Loader.Ready)166 if (shellLoader.status !== Loader.Ready)
164 return;167 return;
@@ -169,6 +172,17 @@
169 }172 }
170 }173 }
171 }174 }
175 Button {
176 text: "Restart Tutorial"
177 anchors { left: parent.left; right: parent.right }
178 onClicked: {
179 if (shellLoader.status !== Loader.Ready)
180 return;
181
182 AccountsService.demoEdges = false;
183 AccountsService.demoEdges = true;
184 }
185 }
172 }186 }
173 ListItem.ItemSelector {187 ListItem.ItemSelector {
174 anchors { left: parent.left; right: parent.right }188 anchors { left: parent.left; right: parent.right }

Subscribers

People subscribed via source and target branches