on xenial help sign in
Make the welcome a little nicer
commitf3f1c26a2c8aff6cb704a95c31fc7f5f2c555aae authorMarius Gripsgard <marius@ubports.com> dateTue 7 Aug 2018, 21:15 (8 years ago) parentd21d2ed
3 files changed+122−20
qml/Wizard/Pages/10-welcome-update.qml+104−15 qml/Wizard/Pages/11-changelog.qml+15−2 qml/Wizard/Pages/80-finished.qml+3−3
qml/Wizard/Pages/10-welcome-update.qml+104−15
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2015-2016 Canonical, Ltd.
2+ * Copyright (C) 2013-2016 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -16,30 +16,119 @@
1616
1717import QtQuick 2.4
1818import Ubuntu.Components 1.3
19−import AccountsService 0.1
2019import Wizard 0.1
2120import ".." as LocalComponents
2221
2322LocalComponents.Page {
2423 objectName: "welcomeUpdate"
25− title: i18n.tr("Welcome to " + System.version)
2624
27− forwardButtonSourceComponent: forwardButton
25+ hasBackButton: false
26+ customTitle: true
27+ buttonBarVisible: false
2828 onlyOnUpdate: true
2929
30− Label {
31− text: "This is where cool stuff would go"
30+ Component.onCompleted: {
31+ state = "reanchored";
3232 }
3333
34− Component {
35− id: forwardButton
36− LocalComponents.StackButton {
37− text: i18n.tr("Next")
38− onClicked: {
39− if (d.validName) {
40− AccountsService.realName = d.validName;
41− }
42− pageStack.next();
34+ states: State {
35+ name: "reanchored"
36+ AnchorChanges { target: bgImage; anchors.top: parent.top; anchors.bottom: parent.bottom }
37+ AnchorChanges { target: column;
38+ anchors.verticalCenter: parent.verticalCenter;
39+ anchors.top: undefined
40+ }
41+ }
42+
43+ SequentialAnimation {
44+ id: splashAnimation
45+ PauseAnimation { duration: UbuntuAnimation.BriskDuration }
46+ SmoothedAnimation {
47+ target: bgImage
48+ property: "height"
49+ to: units.gu(16)
50+ duration: UbuntuAnimation.BriskDuration
51+ }
52+ NumberAnimation {
53+ target: bgImage
54+ property: 'opacity'
55+ from: 1
56+ to: 0
57+ }
58+ }
59+
60+ Image {
61+ id: bgImage
62+ source: wideMode ? "data/Desktop_splash_screen_bkg.png" : "data/Phone_splash_screen_bkg.png"
63+ scale: Image.PreserveAspectFit
64+ anchors.left: parent.left
65+ anchors.right: parent.right
66+ anchors.bottom: parent.top // outside to let it slide down
67+ visible: opacity > 0
68+ }
69+
70+ Item {
71+ id: column
72+ anchors.leftMargin: leftMargin
73+ anchors.rightMargin: rightMargin
74+ anchors.left: parent.left
75+ anchors.right: parent.right
76+ anchors.top: parent.bottom // outside to let it slide in
77+ height: childrenRect.height
78+ visible: opacity > 0
79+
80+ Label {
81+ id: welcomeLabel
82+ anchors.left: parent.left
83+ anchors.right: parent.right
84+ horizontalAlignment: Text.AlignHCenter
85+ wrapMode: Text.Wrap
86+ fontSize: "x-large"
87+ font.weight: Font.Light
88+ lineHeight: 1.2
89+ text: i18n.tr("Welcome to ") + System.version.split("Base-Version: ")[1]
90+ color: whiteColor
91+ }
92+
93+ Label {
94+ id: welcomeText
95+ anchors.left: parent.left
96+ anchors.right: parent.right
97+ anchors.top: welcomeLabel.bottom
98+ anchors.topMargin: units.gu(2)
99+ horizontalAlignment: Text.AlignHCenter
100+ wrapMode: Text.Wrap
101+ fontSize: "large"
102+ font.weight: Font.Light
103+ lineHeight: 1.2
104+ text: i18n.tr("We will make sure your device is ready to use ") + System.version.split("Base-Version: ")[1]
105+ color: whiteColor
106+ }
107+
108+ Rectangle {
109+ anchors {
110+ top: welcomeText.bottom
111+ horizontalCenter: parent.horizontalCenter
112+ topMargin: units.gu(4)
113+ }
114+ color: "transparent"
115+ border.width: units.dp(1)
116+ border.color: whiteColor
117+ radius: units.dp(4)
118+ width: buttonLabel.paintedWidth + units.gu(6)
119+ height: buttonLabel.paintedHeight + units.gu(1.8)
120+
121+ Label {
122+ id: buttonLabel
123+ color: whiteColor
124+ text: i18n.tr("Next")
125+ fontSize: "medium"
126+ anchors.centerIn: parent
127+ }
128+ AbstractButton {
129+ objectName: "nextButton"
130+ anchors.fill: parent
131+ onClicked: pageStack.next();
43132 }
44133 }
45134 }
qml/Wizard/Pages/11-changelog.qml+15−2
@@ -26,8 +26,21 @@ LocalComponents.Page {
2626 forwardButtonSourceComponent: forwardButton
2727 onlyOnUpdate: true
2828
29− Label {
30− text: "This is where cool stuff would go"
29+
30+ Column {
31+ id: column
32+ spacing: units.gu(2)
33+
34+ anchors {
35+ fill: content
36+ leftMargin: wideMode ? parent.leftMargin : staticMargin
37+ rightMargin: wideMode ? parent.rightMargin : staticMargin
38+ topMargin: staticMargin
39+ }
40+
41+ Label {
42+ text: "This is where cool stuff would go"
43+ }
3144 }
3245
3346 Component {
qml/Wizard/Pages/80-finished.qml+3−3
@@ -16,6 +16,7 @@
1616
1717import QtQuick 2.4
1818import Ubuntu.Components 1.3
19+import Wizard 0.1
1920import ".." as LocalComponents
2021
2122LocalComponents.Page {
@@ -25,7 +26,6 @@ LocalComponents.Page {
2526 customTitle: true
2627 lastPage: true
2728 buttonBarVisible: false
28− onlyOnInstall: true
2929
3030 Component.onCompleted: {
3131 state = "reanchored";
@@ -87,7 +87,7 @@ LocalComponents.Page {
8787 fontSize: "x-large"
8888 font.weight: Font.Light
8989 lineHeight: 1.2
90− text: (wizard.runningWizardVersion === 0) ? i18n.tr("Welcome to Ubuntu") : i18n.tr("Welcome Back")
90+ text: (System.isUpdate) ? i18n.tr("Welcome Back") : i18n.tr("Welcome to Ubuntu")
9191 color: whiteColor
9292 }
9393
@@ -122,7 +122,7 @@ LocalComponents.Page {
122122 Label {
123123 id: buttonLabel
124124 color: whiteColor
125− text: (wizard.runningWizardVersion === 0) ? i18n.tr("Get Started") : i18n.tr("Continue")
125+ text: (System.isUpdate) ? i18n.tr("Continue") : i18n.tr("Get Started")
126126 fontSize: "medium"
127127 anchors.centerIn: parent
128128 }