18
18
import Ubuntu.Components 1.3
21
readonly property real buttonMargin: units.gu(2)
22
readonly property real maximumContentWidth: units.gu(50)
23
readonly property bool wideMode: width > units.gu(90) && width > height
24
readonly property bool contentAnimationRunning: contentAnimation.running
26
readonly property real buttonMargin: units.gu(3)
22
27
readonly property real buttonWidth: (width - buttonMargin * 2) / 2 -
24
readonly property real topMargin: units.gu(8)
25
readonly property real leftMargin: units.gu(2)
26
readonly property real rightMargin: units.gu(2)
29
readonly property real buttonBarHeight: units.gu(5)
30
readonly property real titleRectHeight: customTitle ? units.gu(10) : units.gu(16)
32
readonly property real topMargin: units.gu(11)
33
readonly property real bottomMargin: units.gu(3)
34
readonly property real leftMargin: Math.max(units.gu(3), (width - maximumContentWidth) / 3)
35
readonly property real rightMargin: leftMargin
36
readonly property real customMargin: wideMode ? units.gu(8) : units.gu(4) // margin for the content
37
readonly property real staticMargin: units.gu(3)
40
readonly property color backgroundColor: "#fdfdfd"
41
readonly property color dividerColor: UbuntuColors.silk
42
readonly property color textColor: UbuntuColors.slate
43
readonly property color errorColor: theme.palette.normal.negative
44
readonly property color okColor: theme.palette.normal.positive
45
readonly property color whiteColor: "white" // workaround for a UITK bug
28
47
// If you want to skip a page, mark skipValid false while you figure out
29
48
// whether to skip, then set it to true once you've determined the value
44
67
anchors.fill: parent
46
// We want larger than even fontSize: "x-large", so we use a Text instead
72
triggeredOnStart: true
74
running: System.wizardEnabled
76
indicatorTime.text = Qt.formatTime(new Date(), "h:mm")
53
87
right: parent.right
55
leftMargin: leftMargin
56
rightMargin: rightMargin
60
color: theme.palette.normal.baseText
61
font.pixelSize: units.gu(4)
89
source: customTitle ? "" : (wideMode ? "Pages/data/Desktop_header_bkg.png" : "Pages/data/Phone_header_bkg.png")
90
height: titleRectHeight
96
property real animatedTopMargin: 0
100
bottom: parent.bottom
101
bottomMargin: bottomMargin
102
leftMargin: staticMargin
103
rightMargin: rightMargin
104
topMargin: titleLabel.animatedTopMargin
107
color: customTitle ? textColor : backgroundColor
108
fontSize: customTitle ? "large" : "x-large"
109
font.weight: Font.Light
110
wrapMode: Text.WordWrap
112
elide: Text.ElideRight
118
visible: !customTitle
122
topMargin: units.gu(.5)
123
rightMargin: units.gu(.5)
130
anchors.verticalCenter: parent.verticalCenter
132
height: parent.height
134
visible: !(root.simManager0.present || root.simManager1.present) && root.modemManager.modems.length > 0
140
anchors.verticalCenter: parent.verticalCenter
141
name: Status.networkIcon
142
height: parent.height
149
anchors.verticalCenter: parent.verticalCenter
150
name: Status.batteryIcon
151
height: parent.height
152
width: height * 1.4 // the battery icon is not rectangular :/
158
anchors.verticalCenter: parent.verticalCenter
67
top: titleLabel.bottom
70
bottom: backButton.top
71
topMargin: units.gu(4)
72
leftMargin: leftMargin
73
rightMargin: rightMargin
74
bottomMargin: buttonMargin
80
objectName: "backButton"
85
leftMargin: buttonMargin
86
bottomMargin: buttonMargin
89
text: i18n.ctr("Button: Go back one page in the Wizard", "Back")
90
visible: pageStack.depth > 1 && hasBackButton
93
onClicked: customBack ? backClicked() : pageStack.prev()
98
objectName: "forwardButton"
102
bottom: parent.bottom
103
rightMargin: buttonMargin
104
bottomMargin: buttonMargin
168
property real animatedMargin: 0
169
property real animatedTopMargin: 0
171
top: titleRect.bottom
174
bottom: buttonBarVisible ? buttonRect.top : parent.bottom
175
leftMargin: content.animatedMargin
176
rightMargin: -content.animatedMargin
177
topMargin: content.animatedTopMargin
185
visible: buttonBarVisible
187
bottom: parent.bottom
188
bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
192
height: buttonBarHeight
198
objectName: "backButton"
202
bottom: parent.bottom
203
leftMargin: staticMargin
204
verticalCenter: parent.verticalCenter
207
visible: pageStack.depth > 1 && hasBackButton
210
onClicked: customBack ? backClicked() : pageStack.prev()
215
objectName: "forwardButton"
219
bottom: parent.bottom
220
rightMargin: staticMargin
221
verticalCenter: parent.verticalCenter
227
function aboutToShow(duration, direction) {
228
startContentAnimation(duration, direction)
229
startControlsAnimation(duration)
232
function aboutToShowSecondary(duration) {
233
secondaryAnimation.restart()
234
startControlsAnimation(duration)
237
function startContentAnimation(duration, direction) {
238
contentAnimation.animationDurationBase = duration
239
contentAnimation.direction = direction
240
contentAnimation.restart()
243
function startControlsAnimation(showDuration) {
244
actionsShowAnimation.showDuration = showDuration
245
actionsShowAnimation.restart()
248
SequentialAnimation { // animation for the button bar
249
id: actionsShowAnimation
250
property int showDuration: 0
256
PauseAnimation { duration: Math.max(0, actionsShowAnimation.showDuration - UbuntuAnimation.SnapDuration) }
261
duration: UbuntuAnimation.SnapDuration
265
SequentialAnimation { // animations for the content
267
objectName: "contentAnimation"
268
property int animationDurationBase: UbuntuAnimation.BriskDuration
269
readonly property int additionalDuration: 200
270
property int direction: Qt.LeftToRight
271
ScriptAction { // direction of the effect
273
if (contentAnimation.direction === Qt.LeftToRight) {
274
content.animatedMargin = -content.width;
276
content.animatedMargin = content.width;
281
NumberAnimation { // the slide-in animation
283
property: 'animatedMargin'
285
duration: contentAnimation.animationDurationBase + contentAnimation.additionalDuration
286
easing.type: Easing.OutCubic
288
NumberAnimation { // opacity animation
289
targets: [titleLabel,content]
293
duration: contentAnimation.animationDurationBase
298
ParallelAnimation { // animation for the secondary pages
299
id: secondaryAnimation
300
objectName: "secondaryAnimation"
301
NumberAnimation { // the slide-up animation
303
property: 'animatedTopMargin'
306
duration: UbuntuAnimation.BriskDuration
307
easing: UbuntuAnimation.StandardEasing
311
property: 'animatedTopMargin'
314
duration: UbuntuAnimation.BriskDuration
315
easing: UbuntuAnimation.StandardEasing
317
NumberAnimation { // opacity animation
322
duration: UbuntuAnimation.BriskDuration