Lomiri
Loading...
Searching...
No Matches
80-finished.qml
1/*
2 * Copyright (C) 2018 The UBports project
3 * Copyright (C) 2013-2016 Canonical Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.12
19import Lomiri.Components 1.3
20import Wizard 0.1
21import ".." as LocalComponents
22
23LocalComponents.Page {
24 objectName: "finishedPage"
25
26 hasBackButton: false
27 customTitle: true
28 lastPage: true
29 buttonBarVisible: false
30
31 Component.onCompleted: {
32 state = "reanchored";
33 }
34
35 states: State {
36 name: "reanchored"
37 AnchorChanges { target: bgImage; anchors.top: parent.top; anchors.bottom: parent.bottom }
38 AnchorChanges { target: column;
39 anchors.verticalCenter: parent.verticalCenter;
40 anchors.top: undefined
41 }
42 }
43
44 transitions: Transition {
45 ParallelAnimation {
46 AnchorAnimation {
47 targets: [bgImage, column]
48 duration: LomiriAnimation.SlowDuration
49 easing.type: Easing.OutCirc
50 }
51 NumberAnimation {
52 targets: [bgImage,column]
53 property: "opacity"
54 from: 0
55 to: 1
56 duration: LomiriAnimation.SlowDuration
57 easing.type: Easing.OutCirc
58 }
59 }
60 }
61
62 Image {
63 id: bgImage
64 source: wideMode ? "data/Desktop_splash_screen_bkg.png" : "data/Phone_splash_screen_bkg.png"
65 scale: Image.PreserveAspectFit
66 anchors.left: parent.left
67 anchors.right: parent.right
68 anchors.bottom: parent.top // outside to let it slide down
69 visible: opacity > 0
70 }
71
72 Item {
73 id: column
74 anchors.leftMargin: leftMargin
75 anchors.rightMargin: rightMargin
76 anchors.left: parent.left
77 anchors.right: parent.right
78 anchors.top: parent.bottom // outside to let it slide in
79 height: childrenRect.height
80 visible: opacity > 0
81
82 Label {
83 id: welcomeLabel
84 anchors.left: parent.left
85 anchors.right: parent.right
86 horizontalAlignment: Text.AlignHCenter
87 wrapMode: Text.Wrap
88 fontSize: "x-large"
89 font.weight: Font.Light
90 lineHeight: 1.2
91 text: (
92 System.isUpdate
93 ? i18n.tr("Welcome Back")
94 // TRANSLATORS: %1 contains the distro name
95 : i18n.tr("Welcome to %1").arg(System.distroName)
96 )
97 color: whiteColor
98 }
99
100 Label {
101 id: welcomeText
102 anchors.left: parent.left
103 anchors.right: parent.right
104 anchors.top: welcomeLabel.bottom
105 anchors.topMargin: units.gu(2)
106 horizontalAlignment: Text.AlignHCenter
107 wrapMode: Text.Wrap
108 fontSize: "large"
109 font.weight: Font.Light
110 lineHeight: 1.2
111 text: i18n.tr("You are ready to use your device now")
112 color: whiteColor
113 }
114
115 Rectangle {
116 anchors {
117 top: welcomeText.bottom
118 horizontalCenter: parent.horizontalCenter
119 topMargin: units.gu(4)
120 }
121 color: "transparent"
122 border.width: units.dp(1)
123 border.color: whiteColor
124 radius: units.dp(4)
125 width: buttonLabel.paintedWidth + units.gu(6)
126 height: buttonLabel.paintedHeight + units.gu(1.8)
127
128 Label {
129 id: buttonLabel
130 color: whiteColor
131 text: (System.isUpdate) ? i18n.tr("Continue") : i18n.tr("Get Started")
132 fontSize: "medium"
133 anchors.centerIn: parent
134 }
135 AbstractButton {
136 objectName: "finishButton"
137 anchors.fill: parent
138 onClicked: root.quitWizard()
139 }
140 }
141 }
142}