on xenial help sign in
More progress
commite969c9a03dd06a2a24c98e82439616267204aa9f authorMichael Terry <michael.terry@canonical.com> dateThu 18 Dec 2014, 18:32 (12 years ago) parent42f90a4
16 files changed+233−480
qml/Launcher/Launcher.qml+4−1 qml/Shell.qml+6−2 qml/Tutorial/Arrow.qml+30−19 qml/Tutorial/Bar.qml−99 qml/Tutorial/Slider.qml+117 qml/Tutorial/Tutorial.qml+6−109 qml/Tutorial/TutorialIntro.qml−29 qml/Tutorial/TutorialLeft.qml+18−8 qml/Tutorial/TutorialLeftFinish.qml+22−1 qml/Tutorial/TutorialLeftRelease.qml−24 qml/Tutorial/TutorialPage.qml+30−105 qml/Tutorial/TutorialTop.qml−42 qml/Tutorial/TutorialTopFinish.qml−41 qml/Tutorial/graphics/arrow-down.png qml/Tutorial/graphics/chevron.png qml/Tutorial/graphics/tick.png
qml/Launcher/Launcher.qml+4−1
@@ -34,6 +34,9 @@ Item {
3434 property real progress: dragArea.dragging && dragArea.touchX > panelWidth ?
3535 (width * (dragArea.touchX-panelWidth) / (width - panelWidth)) : 0
3636
37+ readonly property real dragDistance: dragArea.dragging ? dragArea.touchX : 0
38+ readonly property real visibleWidth: panel.width + panel.x
39+
3740 readonly property bool shown: panel.x > -panel.width
3841
3942 // emitted when an application is selected
@@ -181,7 +184,7 @@ Item {
181184 right: parent.right
182185 bottom: parent.bottom
183186 }
184− enabled: root.state == "visible"
187+ enabled: root.shadeBackground && root.state == "visible"
185188 onPressed: {
186189 root.state = ""
187190 }
qml/Shell.qml+6−2
@@ -624,9 +624,13 @@ Item {
624624 LauncherModel.setUser(user);
625625 }
626626
627− onTapped: launcher.tease()
627+ onTapped: {
628+ if (!tutorial.running) {
629+ launcher.tease();
630+ }
631+ }
628632 onDraggingChanged: {
629− if (dragging) {
633+ if (dragging && !tutorial.running) {
630634 launcher.tease();
631635 }
632636 }
qml/Tutorial/Arrow.qml+30−19
@@ -17,29 +17,40 @@
1717import QtQuick 2.3
1818import Ubuntu.Components 1.1
1919
20−Image {
21− // Valid values are: down, up, right, left
22− property string direction
20+Item {
21+ id: root
2322
24− readonly property real offset: units.gu(6)
23+ property alias color: circle.color
24+
25+ // Will make whole arrow darker
26+ property real darkenBy: 0
27+
28+ property alias chevronOpacity: chevron.opacity
2529
2630 ////
2731
28− visible: direction !== ""
29− source: Qt.resolvedUrl("graphics/arrow-down.png")
30−
31− rotation: {
32− if (direction === "up") {
33− return 180;
34− } else if (direction === "left") {
35− return 90;
36− } else if (direction === "right") {
37− return -90;
38− } else {
39− return 0;
40− }
32+ Rectangle {
33+ id: circle
34+ anchors.fill: parent
35+ radius: width / 2
4136 }
4237
43− height: units.gu(9)
44− sourceSize.height: height
38+ Image {
39+ id: chevron
40+ anchors.centerIn: parent
41+ source: Qt.resolvedUrl("graphics/chevron.png")
42+ fillMode: Image.PreserveAspectFit
43+ sourceSize.width: 152
44+ sourceSize.height: 152
45+ width: parent.width / 2
46+ height: parent.height / 2
47+ }
48+
49+ Rectangle {
50+ id: darkCircle
51+ anchors.fill: parent
52+ radius: width / 2
53+ color: "black"
54+ opacity: root.darkenBy
55+ }
4556}
qml/Tutorial/Bar.qmldeleted−99
@@ -1,99 +0,0 @@
1−/*
2− * Copyright (C) 2014 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 QtGraphicalEffects 1.0
18−import QtQuick 2.3
19−import Ubuntu.Components 1.1
20−import "../Components"
21−
22−Item {
23− id: root
24−
25− // Valid values are: down, up, right, left
26− property string direction
27−
28− property bool animating: true
29−
30− readonly property real offset: edgeHint.size / 4
31−
32− ////
33−
34− visible: direction !== ""
35− implicitHeight: direction === "down" || direction === "up" ? hintAnimation.maxGlow : 0
36− implicitWidth: direction === "left" || direction === "right" ? hintAnimation.maxGlow : 0
37−
38− LinearGradient {
39− id: edgeHint
40− property int size: 1
41− cached: false
42− gradient: Gradient {
43− GradientStop {
44− position: 0.0
45− color: UbuntuColors.orange
46− }
47− GradientStop {
48− position: 1.0
49− color: "transparent"
50− }
51− }
52− anchors.fill: parent
53− start: {
54− if (root.direction == "left") {
55− return Qt.point(width, 0);
56− } else if (root.direction == "right") {
57− return Qt.point(0, 0);
58− } else if (root.direction == "down") {
59− return Qt.point(0, 0);
60− } else {
61− return Qt.point(0, height);
62− }
63− }
64− end: {
65− if (root.direction == "left") {
66− return Qt.point(width - size, 0);
67− } else if (root.direction == "right") {
68− return Qt.point(size, 0);
69− } else if (root.direction == "down") {
70− return Qt.point(0, size);
71− } else {
72− return Qt.point(0, height - size);
73− }
74− }
75− }
76−
77− SequentialAnimation {
78− id: hintAnimation
79− loops: Animation.Infinite
80− running: root.animating && root.visible
81− property double maxGlow: units.gu(4)
82− property int duration: UbuntuAnimation.SleepyDuration
83−
84− StandardAnimation {
85− target: edgeHint
86− property: "size"
87− to: hintAnimation.maxGlow
88− duration: hintAnimation.duration
89− }
90−
91− // Undo the above
92− StandardAnimation {
93− target: edgeHint
94− property: "size"
95− to: 1
96− duration: hintAnimation.duration
97− }
98− }
99−}
qml/Tutorial/Slider.qmlnew file+117
@@ -0,0 +1,117 @@
1+/*
2+ * Copyright (C) 2014 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.3
18+import Ubuntu.Components 1.1
19+
20+Item {
21+ id: root
22+
23+ // Whether this slider is short or long
24+ property bool shortSwipe
25+
26+ // How far the user has slid
27+ property real offset
28+
29+ // Set to true when slider is being used
30+ property bool active
31+
32+ // How far in percentage terms
33+ readonly property real percent: d.slideOffset / target.x
34+
35+ QtObject {
36+ id: d
37+ readonly property real margin: units.gu(0.5)
38+ readonly property real arrowSize: root.height - margin * 2
39+ readonly property real dotSize: units.dp(1)
40+ readonly property real slideOffset: Math.min(root.offset, target.x)
41+ }
42+
43+ implicitWidth: shortSwipe ? units.gu(15) : units.gu(27.5)
44+ implicitHeight: units.gu(6.5)
45+
46+ Rectangle {
47+ color: "black"
48+ opacity: 0.4
49+ anchors.fill: parent
50+ anchors.rightMargin: clipBox.width - 1
51+ }
52+
53+ // We want to have a circular border around the target. But we can't just
54+ // do a radius on two of a rectangle's corners. So we clip a full circle.
55+ Item {
56+ id: clipBox
57+
58+ clip: true
59+ anchors.top: parent.top
60+ anchors.bottom: parent.bottom
61+ anchors.right: parent.right
62+ width: parent.height / 2
63+
64+ Rectangle {
65+ color: "black"
66+ opacity: 0.4
67+ anchors.top: parent.top
68+ anchors.bottom: parent.bottom
69+ anchors.right: parent.right
70+ width: parent.width * 2
71+ radius: parent.width
72+ }
73+ }
74+
75+ Arrow {
76+ id: target
77+ width: d.arrowSize
78+ height: d.arrowSize
79+ color: "black"
80+ chevronOpacity: 0.2
81+ anchors.right: parent.right
82+ anchors.rightMargin: d.margin
83+ anchors.verticalCenter: parent.verticalCenter
84+ }
85+
86+ Row {
87+ anchors.left: handle.horizontalCenter
88+ anchors.right: target.horizontalCenter
89+ anchors.verticalCenter: parent.verticalCenter
90+
91+ layoutDirection: Qt.RightToLeft
92+ spacing: d.dotSize * 2
93+
94+ Repeater {
95+ model: parent.width / (parent.spacing + d.dotSize)
96+ Rectangle {
97+ anchors.verticalCenter: parent ? parent.verticalCenter : undefined
98+ height: d.dotSize
99+ width: height
100+ radius: width
101+ color: "white"
102+ opacity: 0.2
103+ }
104+ }
105+ }
106+
107+ Arrow {
108+ id: handle
109+ width: d.arrowSize
110+ height: d.arrowSize
111+ color: UbuntuColors.orange
112+ darkenBy: root.active ? 0.5 : 0
113+ anchors.left: parent.left
114+ anchors.leftMargin: d.slideOffset
115+ anchors.verticalCenter: parent.verticalCenter
116+ }
117+}
qml/Tutorial/Tutorial.qml+6−109
@@ -26,13 +26,9 @@ Item {
2626 property Item overlay
2727
2828 readonly property bool launcherEnabled: !running ||
29− loader.sourceComponent === leftComponent ||
30− loader.sourceComponent === leftFinishComponent ||
31− loader.sourceComponent === leftReleaseComponent
29+ loader.target === leftComponent
3230 readonly property bool stagesEnabled: !running
33− readonly property bool panelEnabled: !running ||
34− loader.sourceComponent === topComponent ||
35− loader.sourceComponent === topFinishComponent
31+ readonly property bool panelEnabled: !running
3632 readonly property bool panelContentEnabled: !running
3733 readonly property bool running: loader.sourceComponent !== null
3834
@@ -57,62 +53,23 @@ Item {
5753
5854 QtObject {
5955 id: d
60− property int pageTotal: 2
6156
6257 function stop() {
6358 loader.sourceComponent = null;
6459 }
6560
6661 function start() {
67− loader.load(introComponent);
68− }
69− }
70−
71− Connections {
72− target: root.panel.indicators
73−
74− onFullyOpenedChanged: {
75− if (loader.target === topComponent &&
76− root.panel.indicators.fullyOpened) {
77− loader.load(topFinishComponent);
78− }
79− }
80−
81− onPartiallyOpenedChanged: {
82− if (loader.target === topFinishComponent &&
83− !root.panel.indicators.partiallyOpened &&
84− !root.panel.indicators.fullyOpened) {
85− loader.load(leftComponent);
86− }
62+ loader.load(leftComponent);
8763 }
8864 }
8965
9066 Connections {
9167 target: root.launcher
9268
93− onProgressChanged: {
94− if (loader.target === leftComponent && launcher.progress > 0) {
95− loader.load(leftReleaseComponent);
96− }
97− }
98−
99− onShownChanged: {
100− // This stanza is necessary because user might have dragged the
101− // launcher far enough to trigger the progress check above, but
102− // then dragged it back into its original position.
103− if (loader.target === leftReleaseComponent && !launcher.shown) {
104− loader.load(null);
105− }
106− }
107−
10869 onStateChanged: {
10970 if (launcher.state === "visible") {
11071 if (loader.target === leftComponent) {
111− // happens if user didn't drag past launcher
11272 loader.load(leftFinishComponent);
113− } else if (loader.target === leftReleaseComponent) {
114− loader.load(null);
115− launcher.hide();
11673 }
11774 }
11875 }
@@ -159,50 +116,6 @@ Item {
159116 property: "paused"
160117 value: root.paused
161118 }
162−
163− Binding {
164− target: loader.item
165− property: "pageTotal"
166− value: d.pageTotal
167− }
168− }
169−
170− Component {
171− id: introComponent
172− TutorialIntro {
173− objectName: "tutorialIntro"
174− parent: root.stages
175− anchors.fill: parent
176− onShownChanged: if (!shown) loader.load(topComponent)
177− }
178− }
179−
180− Component {
181− id: topComponent
182− TutorialTop {
183− objectName: "tutorialTop"
184− parent: root.panel
185− anchors.fill: parent
186− mouseArea {
187− anchors.topMargin: root.panel.indicators.minimizedPanelHeight
188− }
189− pageNumber: 1
190− }
191− }
192−
193− Component {
194− id: topFinishComponent
195− TutorialTopFinish {
196− objectName: "tutorialTopFinish"
197− parent: root.panel
198− anchors.bottom: parent ? parent.bottom : undefined
199− anchors.left: parent ? parent.left : undefined
200− anchors.right: parent ? parent.right : undefined
201− mouseArea {
202− anchors.bottomMargin: root.panel.indicators.hideDragHandle.height
203− }
204− height: root.panel.height
205− }
206119 }
207120
208121 Component {
@@ -211,18 +124,7 @@ Item {
211124 objectName: "tutorialLeft"
212125 parent: root.stages
213126 anchors.fill: parent
214− pageNumber: 2
215− }
216− }
217−
218− Component {
219− id: leftReleaseComponent
220− TutorialLeftRelease {
221− objectName: "tutorialLeftRelease"
222− parent: root.stages
223− anchors.fill: parent
224− textXOffset: root.launcher.panelWidth
225− backgroundFadesOut: true
127+ launcher: root.launcher
226128 }
227129 }
228130
@@ -234,13 +136,8 @@ Item {
234136 anchors.fill: parent
235137 textXOffset: root.launcher.panelWidth
236138 backgroundFadesOut: true
237− mouseArea {
238− parent: root.overlay
239− onClicked: {
240− loader.load(null);
241− root.launcher.hide();
242− }
243− }
139+
140+ onFinished: root.launcher.hide()
244141 }
245142 }
246143}
qml/Tutorial/TutorialIntro.qmldeleted−29
@@ -1,29 +0,0 @@
1−/*
2− * Copyright (C) 2014 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.3
18−import Ubuntu.Components 1.1
19−
20−TutorialPage {
21− id: root
22−
23− title: i18n.tr("Quick tips")
24− text: i18n.tr("The following tips are designed to help you learn how to use your phone. <b>Tap</b> the screen to continue…")
25−
26− mouseArea {
27− onClicked: root.hide()
28− }
29−}
qml/Tutorial/TutorialLeft.qml+18−8
@@ -16,27 +16,37 @@
1616
1717import QtQuick 2.3
1818import Ubuntu.Components 1.1
19+import "." as LocalComponents
1920
2021TutorialPage {
2122 id: root
2223
23− title: i18n.tr("Left edge")
24− text: i18n.tr("Swipe from the <b>left edge</b> to see your <b>favorite apps</b> in the <b>Launcher</b>.")
24+ property var launcher
2525
26− bar {
27− direction: "right"
26+ title: i18n.tr("Open the launcher")
27+ text: i18n.tr("Short swipe from the left edge.")
28+
29+ textXOffset: root.launcher.visibleWidth
30+
31+ Timer {
32+ id: teaseTimer
33+ interval: 2000
34+ repeat: true
35+ running: !root.paused
36+ onTriggered: root.launcher.tease()
2837 }
2938
3039 foreground {
3140 children: [
32− Arrow {
33− direction: "right"
41+ LocalComponents.Slider {
3442 anchors {
3543 left: parent.left
36− leftMargin: offset + bar.offset
3744 top: parent.top
38− topMargin: offset
45+ topMargin: root.textBottom + units.gu(3)
3946 }
47+ offset: root.launcher.visibleWidth + root.launcher.progress
48+ active: root.launcher.dragDistance > 0
49+ shortSwipe: true
4050 }
4151 ]
4252 }
qml/Tutorial/TutorialLeftFinish.qml+22−1
@@ -20,5 +20,26 @@ import Ubuntu.Components 1.1
2020TutorialPage {
2121 id: root
2222
23− text: i18n.tr("<b>Tap</b> the screen to hide it again and you’re all set!")
23+ title: i18n.tr("These are the shortcuts to favorite apps")
24+ text: i18n.tr("Tap here to finish.")
25+
26+ foreground {
27+ children: [
28+ Image {
29+ anchors {
30+ horizontalCenter: parent.horizontalCenter
31+ top: parent.top
32+ topMargin: root.textBottom + units.gu(3)
33+ }
34+ source: Qt.resolvedUrl("graphics/tick.png")
35+ height: units.gu(6.5)
36+ width: units.gu(6.5)
37+
38+ MouseArea {
39+ anchors.fill: parent
40+ onClicked: root.hide()
41+ }
42+ }
43+ ]
44+ }
2445}
qml/Tutorial/TutorialLeftRelease.qmldeleted−24
@@ -1,24 +0,0 @@
1−/*
2− * Copyright (C) 2014 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.3
18−import Ubuntu.Components 1.1
19−
20−TutorialPage {
21− id: root
22−
23− text: i18n.tr("<b>Release</b> to hide the <b>Launcher</b> again and you’re all set!")
24−}
qml/Tutorial/TutorialPage.qml+30−105
@@ -27,30 +27,21 @@ Showable {
2727 // This is the block of text displayed below the header
2828 property alias text: textLabel.text
2929
30− // This is the text for the skip button
31− property string skipText: i18n.tr("Skip tutorial")
32−
3330 // Whether animations are paused
3431 property bool paused
3532
36− // Which page number this page represents, 1-indexed
37− property int pageNumber
38−
39− // How many pages there are total
40− property int pageTotal
41−
4233 // Whether whole page (background + foreground) or just the foreground fades in
4334 property bool backgroundFadesIn: false
4435
4536 // Whether whole page (background + foreground) or just the foreground fades out
4637 property bool backgroundFadesOut: false
4738
48− // An integrated glowing Bar class, for convenience
49− property alias bar: bar
50−
5139 // The foreground Item, add children to it that you want to fade in
5240 property alias foreground: foregroundExtra
5341
42+ // The text label bottom, so you can position elements relative to it
43+ property real textBottom: textLabel.y + textLabel.height
44+
5445 // The MouseArea that eats events (so you can adjust size as you will)
5546 property alias mouseArea: mouseArea
5647
@@ -58,6 +49,9 @@ Showable {
5849 property real textXOffset: 0
5950 property real textYOffset: 0
6051
52+ // Foreground opacity
53+ property real foregroundOpacity: 1
54+
6155 signal finished()
6256
6357 ////
@@ -65,17 +59,17 @@ Showable {
6559 shown: false
6660 Component.onCompleted: show()
6761
68− property alias _foregroundOpacity: foreground.opacity
62+ property real _foregroundHideOpacity
6963
7064 showAnimation: StandardAnimation {
71− property: root.backgroundFadesIn ? "opacity" : "_foregroundOpacity"
65+ property: root.backgroundFadesIn ? "opacity" : "_foregroundHideOpacity"
7266 from: 0
7367 to: 1
7468 duration: root.backgroundFadesIn ? UbuntuAnimation.SleepyDuration : UbuntuAnimation.BriskDuration
7569 }
7670
7771 hideAnimation: StandardAnimation {
78− property: root.backgroundFadesOut ? "opacity" : "_foregroundOpacity"
72+ property: root.backgroundFadesOut ? "opacity" : "_foregroundHideOpacity"
7973 to: 0
8074 duration: UbuntuAnimation.BriskDuration
8175 onRunningChanged: {
@@ -88,10 +82,9 @@ Showable {
8882 QtObject {
8983 id: d
9084
91− property real sideMargin: units.gu(6)
92− property real verticalOffset: -units.gu(3)
93− property real buttonMargin: units.gu(2)
94− property real paginationOffset: units.gu(12)
85+ readonly property real sideMargin: units.gu(5.5)
86+ readonly property real verticalOffset: -units.gu(9)
87+ readonly property real textXOffset: Math.max(0, root.textXOffset - sideMargin + units.gu(2))
9588
9689 property real fadeInOffset: {
9790 if (showAnimation.running) {
@@ -101,25 +94,6 @@ Showable {
10194 return 0;
10295 }
10396 }
104−
105− property real xLabelOffset: {
106− if (bar.direction === "right") {
107− return bar.offset - fadeInOffset + root.textXOffset;
108− } else if (bar.direction === "left") {
109− return -bar.offset + fadeInOffset + root.textXOffset;
110− } else {
111− return root.textXOffset;
112− }
113− }
114− property real yLabelOffset: {
115− if (bar.direction === "down") {
116− return bar.offset - fadeInOffset + root.textYOffset;
117− } else if (bar.direction === "up") {
118− return -bar.offset + fadeInOffset + root.textYOffset;
119− } else {
120− return root.textYOffset;
121− }
122− }
12397 }
12498
12599 MouseArea { // eat any errant presses
@@ -130,95 +104,46 @@ Showable {
130104 Rectangle {
131105 anchors.fill: parent
132106 color: "black"
133− opacity: 0.8
107+ opacity: 0.82
134108 }
135109
136110 Item {
137111 id: foreground
138112 anchors.fill: parent
113+ opacity: root.foregroundOpacity < 1 ? root.foregroundOpacity : root._foregroundHideOpacity
139114
140115 Label {
141116 id: titleLabel
142117 anchors {
143− bottom: textLabel.top
144− bottomMargin: units.gu(2)
145− horizontalCenter: parent.horizontalCenter
146− horizontalCenterOffset: d.xLabelOffset - root.textXOffset / 2
118+ top: parent.verticalCenter
119+ topMargin: d.verticalOffset + root.textYOffset
120+ left: parent.left
121+ leftMargin: d.sideMargin + d.textXOffset
147122 }
148− width: parent.width - d.sideMargin * 2 - root.textXOffset
149− horizontalAlignment: Text.AlignHCenter
123+ width: parent.width - d.sideMargin * 2
124+ horizontalAlignment: Text.AlignLeft
150125 wrapMode: Text.Wrap
151− font.pixelSize: units.gu(4)
126+ font.weight: Font.Light
127+ font.pixelSize: units.gu(3.5)
152128 text: root.title
153129 }
154130
155131 Label {
156132 id: textLabel
157133 anchors {
158− top: parent.verticalCenter
159− topMargin: d.verticalOffset + d.yLabelOffset
160− horizontalCenter: parent.horizontalCenter
161− horizontalCenterOffset: d.xLabelOffset - root.textXOffset / 2
134+ top: titleLabel.bottom
135+ topMargin: units.gu(2)
136+ left: parent.left
137+ leftMargin: d.sideMargin + d.textXOffset
162138 }
163− width: parent.width - d.sideMargin * 2 - root.textXOffset
164− horizontalAlignment: Text.AlignHCenter
139+ width: (parent.width - d.sideMargin * 2) * 0.66
140+ horizontalAlignment: Text.AlignLeft
165141 wrapMode: Text.Wrap
166− fontSize: "large"
142+ font.weight: Font.Light
143+ font.pixelSize: units.gu(2.5)
167144 text: root.text
168145 }
169146
170− Row {
171− visible: root.pageNumber > 0
172− spacing: units.gu(0.5)
173− anchors {
174− bottom: parent.bottom
175− bottomMargin: d.paginationOffset
176− horizontalCenter: parent.horizontalCenter
177− }
178− Repeater {
179− model: root.pageTotal
180− Image {
181− height: units.gu(1)
182− width: height
183− source: (index === root.pageNumber - 1) ?
184− "../Dash/graphics/pagination_dot_on.png" :
185− "../Dash/graphics/pagination_dot_off.png"
186− }
187− }
188− }
189−
190− MouseArea {
191− visible: root.pageNumber > 0
192− enabled: visible
193− anchors {
194− bottom: parent.bottom
195− right: parent.right
196− }
197− implicitHeight: skipLabel.height + d.buttonMargin * 2
198− implicitWidth: skipLabel.width + d.buttonMargin * 2
199−
200− Label {
201− id: skipLabel
202− objectName: "skipLabel"
203− anchors.centerIn: parent
204− // Translators: This is the arrow for "Skip tutorial" buttons
205− text: i18n.tr("%1 〉").arg(root.skipText)
206− }
207−
208− onClicked: root.hide()
209− }
210−
211− Bar {
212− id: bar
213− animating: !root.paused
214− anchors {
215− top: direction === "up" ? undefined : parent.top
216− bottom: direction === "down" ? undefined : parent.bottom
217− left: direction === "left" ? undefined : parent.left
218− right: direction === "right" ? undefined : parent.right
219− }
220− }
221−
222147 // A place for subclasses to add extra widgets
223148 Item {
224149 id: foregroundExtra
qml/Tutorial/TutorialTop.qmldeleted−42
@@ -1,42 +0,0 @@
1−/*
2− * Copyright (C) 2014 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.3
18−import Ubuntu.Components 1.1
19−
20−TutorialPage {
21− id: root
22−
23− title: i18n.tr("Top edge")
24− text: i18n.tr("<b>Swipe down</b> from the <b>top edge</b> to see <b>settings and notifications</b>.")
25−
26− bar {
27− direction: "down"
28− }
29−
30− foreground {
31− children: [
32− Arrow {
33− direction: "down"
34− anchors {
35− top: parent.top
36− topMargin: offset + bar.offset
37− horizontalCenter: parent.horizontalCenter
38− }
39− }
40− ]
41− }
42−}
qml/Tutorial/TutorialTopFinish.qmldeleted−41
@@ -1,41 +0,0 @@
1−/*
2− * Copyright (C) 2014 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.3
18−import Ubuntu.Components 1.1
19−
20−TutorialPage {
21− id: root
22−
23− text: i18n.tr("<b>Swipe up</b> again to close the <b>Settings</b> menu.")
24−
25− bar {
26− direction: "up"
27− }
28−
29− foreground {
30− children: [
31− Arrow {
32− direction: "up"
33− anchors {
34− bottom: parent.bottom
35− bottomMargin: offset + bar.offset
36− horizontalCenter: parent.horizontalCenter
37− }
38− }
39− ]
40− }
41−}
qml/Tutorial/graphics/arrow-down.pngdeleted

Binary file not shown.

qml/Tutorial/graphics/chevron.pngnew file

Binary file not shown.

qml/Tutorial/graphics/tick.pngnew file

Binary file not shown.