Lomiri
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 
18 import QtQuick 2.4
19 import Lomiri.Components 1.3
20 import Wizard 0.1
21 import ".." as LocalComponents
22 
23 LocalComponents.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: (System.isUpdate) ? i18n.tr("Welcome Back") : i18n.tr("Welcome to Lomiri")
92  color: whiteColor
93  }
94 
95  Label {
96  id: welcomeText
97  anchors.left: parent.left
98  anchors.right: parent.right
99  anchors.top: welcomeLabel.bottom
100  anchors.topMargin: units.gu(2)
101  horizontalAlignment: Text.AlignHCenter
102  wrapMode: Text.Wrap
103  fontSize: "large"
104  font.weight: Font.Light
105  lineHeight: 1.2
106  text: i18n.tr("You are ready to use your device now")
107  color: whiteColor
108  }
109 
110  Rectangle {
111  anchors {
112  top: welcomeText.bottom
113  horizontalCenter: parent.horizontalCenter
114  topMargin: units.gu(4)
115  }
116  color: "transparent"
117  border.width: units.dp(1)
118  border.color: whiteColor
119  radius: units.dp(4)
120  width: buttonLabel.paintedWidth + units.gu(6)
121  height: buttonLabel.paintedHeight + units.gu(1.8)
122 
123  Label {
124  id: buttonLabel
125  color: whiteColor
126  text: (System.isUpdate) ? i18n.tr("Continue") : i18n.tr("Get Started")
127  fontSize: "medium"
128  anchors.centerIn: parent
129  }
130  AbstractButton {
131  objectName: "finishButton"
132  anchors.fill: parent
133  onClicked: root.quitWizard()
134  }
135  }
136  }
137 }