Unity 8
80-finished.qml
1 /*
2  * Copyright (C) 2013-2016 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.4
18 import Ubuntu.Components 1.3
19 import ".." as LocalComponents
20 
21 LocalComponents.Page {
22  objectName: "finishedPage"
23 
24  hasBackButton: false
25  customTitle: true
26  lastPage: true
27  buttonBarVisible: false
28 
29  Component.onCompleted: {
30  state = "reanchored";
31  }
32 
33  states: State {
34  name: "reanchored"
35  AnchorChanges { target: bgImage; anchors.top: parent.top; anchors.bottom: parent.bottom }
36  AnchorChanges { target: column;
37  anchors.verticalCenter: parent.verticalCenter;
38  anchors.top: undefined
39  }
40  }
41 
42  transitions: Transition {
43  ParallelAnimation {
44  AnchorAnimation {
45  targets: [bgImage, column]
46  duration: UbuntuAnimation.SlowDuration
47  easing.type: Easing.OutCirc
48  }
49  NumberAnimation {
50  targets: [bgImage,column]
51  property: "opacity"
52  from: 0
53  to: 1
54  duration: UbuntuAnimation.SlowDuration
55  easing.type: Easing.OutCirc
56  }
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 Ubuntu")
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("You are ready to use your device now")
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("Get Started")
125  fontSize: "medium"
126  anchors.centerIn: parent
127  }
128  AbstractButton {
129  objectName: "finishButton"
130  anchors.fill: parent
131  onClicked: root.quitWizard()
132  }
133  }
134  }
135 }