@@ -15,16 +15,22 @@
17import QtQuick 2.4
17import QtQuick 2.4
18+import QtQuick.Layouts 1.1
18import Ubuntu.Components 1.3
19import Ubuntu.Components 1.3
19import UInput 0.1
20import UInput 0.1
22 property var uinput: UInput {
24 property var uinput: UInput {
23 Component.onCompleted: createMouse();
25 Component.onCompleted: createMouse();
24 Component.onDestruction: removeMouse();
26 Component.onDestruction: removeMouse();
29+ function runTutorial() {
27− readonly property bool pressed: point1.pressed || point2.pressed
33+ readonly property bool pressed: point1.pressed || point2.pressed || leftButton.pressed || rightButton.pressed
29 MultiPointTouchArea {
35 MultiPointTouchArea {
30 objectName: "touchPadArea"
36 objectName: "touchPadArea"
@@ -135,4 +141,149 @@ Item {
146+ anchors { left: parent.left; right: parent.right; bottom: parent.bottom; margins: -units.gu(1) }
147+ height: units.gu(10)
148+ spacing: units.gu(1)
152+ Layout.fillWidth: true
153+ Layout.fillHeight: true
154+ onPressed: uinput.pressMouse(UInput.ButtonLeft);
155+ onReleased: uinput.releaseMouse(UInput.ButtonLeft);
156+ property bool highlight: false
158+ anchors.fill: parent
159+ backgroundColor: leftButton.highlight || leftButton.pressed ? UbuntuColors.ash : UbuntuColors.inkstone
160+ Behavior on backgroundColor { ColorAnimation { duration: UbuntuAnimation.FastDuration } }
166+ Layout.fillWidth: true
167+ Layout.fillHeight: true
168+ onPressed: uinput.pressMouse(UInput.ButtonRight);
169+ onReleased: uinput.releaseMouse(UInput.ButtonRight);
170+ property bool highlight: false
172+ anchors.fill: parent
173+ backgroundColor: rightButton.highlight || rightButton.pressed ? UbuntuColors.ash : UbuntuColors.inkstone
174+ Behavior on backgroundColor { ColorAnimation { duration: UbuntuAnimation.FastDuration } }
181+ anchors { left: parent.left; top: parent.top; right: parent.right; margins: units.gu(4); topMargin: units.gu(10) }
185+ wrapMode: Text.WordWrap
192+ property real scale: 1
195+ width: parent.width * parent.scale
197+ anchors.centerIn: parent
199+ color: UbuntuColors.inkstone
207+ property real scale: 1
210+ width: parent.width * parent.scale
212+ anchors.centerIn: parent
214+ color: UbuntuColors.inkstone
218+ SequentialAnimation {
220+ PauseAnimation { duration: UbuntuAnimation.SleepyDuration }
221+ PropertyAction { target: tutorialLabel; property: "text"; value: i18n.tr("Tap left button to click") }
222+ UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
223+ SequentialAnimation {
225+ PropertyAction { target: leftButton; property: "highlight"; value: true }
226+ PauseAnimation { duration: UbuntuAnimation.FastDuration }
227+ PropertyAction { target: leftButton; property: "highlight"; value: false }
228+ PauseAnimation { duration: UbuntuAnimation.SleepyDuration }
230+ UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 0; duration: UbuntuAnimation.FastDuration }
232+ PauseAnimation { duration: UbuntuAnimation.SleepyDuration }
233+ PropertyAction { target: tutorialLabel; property: "text"; value: i18n.tr("Tap right button to right click") }
234+ UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
235+ SequentialAnimation {
237+ PropertyAction { target: rightButton; property: "highlight"; value: true }
238+ PauseAnimation { duration: UbuntuAnimation.FastDuration }
239+ PropertyAction { target: rightButton; property: "highlight"; value: false }
240+ PauseAnimation { duration: UbuntuAnimation.SleepyDuration }
242+ UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 0; duration: UbuntuAnimation.FastDuration }
244+ PauseAnimation { duration: UbuntuAnimation.SleepyDuration }
245+ PropertyAction { target: tutorialLabel; property: "text"; value: i18n.tr("Swipe with two fingers to scroll") }
246+ UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
247+ PropertyAction { target: tutorialFinger1; property: "x"; value: root.width / 2 - tutorialFinger1.width - units.gu(1) }
248+ PropertyAction { target: tutorialFinger2; property: "x"; value: root.width / 2 + tutorialFinger1.width + units.gu(1) - tutorialFinger2.width }
249+ PropertyAction { target: tutorialFinger1; property: "y"; value: root.height / 2 - units.gu(10) }
250+ PropertyAction { target: tutorialFinger2; property: "y"; value: root.height / 2 - units.gu(10) }
251+ SequentialAnimation {
253+ UbuntuNumberAnimation { target: tutorialFinger1; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
254+ UbuntuNumberAnimation { target: tutorialFinger2; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
255+ UbuntuNumberAnimation { target: tutorialFinger1; property: "scale"; from: 0; to: 1; duration: UbuntuAnimation.FastDuration }
256+ UbuntuNumberAnimation { target: tutorialFinger2; property: "scale"; from: 0; to: 1; duration: UbuntuAnimation.FastDuration }
259+ UbuntuNumberAnimation { target: tutorialFinger1; property: "y"; to: root.height / 2 + units.gu(10); duration: UbuntuAnimation.SleepyDuration }
260+ UbuntuNumberAnimation { target: tutorialFinger2; property: "y"; to: root.height / 2 + units.gu(10); duration: UbuntuAnimation.SleepyDuration }
263+ UbuntuNumberAnimation { target: tutorialFinger1; property: "opacity"; to: 0; duration: UbuntuAnimation.FastDuration }
264+ UbuntuNumberAnimation { target: tutorialFinger2; property: "opacity"; to: 0; duration: UbuntuAnimation.FastDuration }
265+ UbuntuNumberAnimation { target: tutorialFinger1; property: "scale"; from: 1; to: 0; duration: UbuntuAnimation.FastDuration }
266+ UbuntuNumberAnimation { target: tutorialFinger2; property: "scale"; from: 1; to: 0; duration: UbuntuAnimation.FastDuration }
268+ PauseAnimation { duration: UbuntuAnimation.SlowDuration }
270+ UbuntuNumberAnimation { target: tutorialFinger1; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
271+ UbuntuNumberAnimation { target: tutorialFinger2; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
272+ UbuntuNumberAnimation { target: tutorialFinger1; property: "scale"; from: 0; to: 1; duration: UbuntuAnimation.FastDuration }
273+ UbuntuNumberAnimation { target: tutorialFinger2; property: "scale"; from: 0; to: 1; duration: UbuntuAnimation.FastDuration }
276+ UbuntuNumberAnimation { target: tutorialFinger1; property: "y"; to: root.height / 2 - units.gu(10); duration: UbuntuAnimation.SleepyDuration }
277+ UbuntuNumberAnimation { target: tutorialFinger2; property: "y"; to: root.height / 2 - units.gu(10); duration: UbuntuAnimation.SleepyDuration }
280+ UbuntuNumberAnimation { target: tutorialFinger1; property: "opacity"; to: 0; duration: UbuntuAnimation.FastDuration }
281+ UbuntuNumberAnimation { target: tutorialFinger2; property: "opacity"; to: 0; duration: UbuntuAnimation.FastDuration }
282+ UbuntuNumberAnimation { target: tutorialFinger1; property: "scale"; from: 1; to: 0; duration: UbuntuAnimation.FastDuration }
283+ UbuntuNumberAnimation { target: tutorialFinger2; property: "scale"; from: 1; to: 0; duration: UbuntuAnimation.FastDuration }
285+ PauseAnimation { duration: UbuntuAnimation.SleepyDuration }
287+ UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 0; duration: UbuntuAnimation.FastDuration }