@@ -27,9 +27,6 @@ Showable {
27 // This is the block of text displayed below the header
27 // This is the block of text displayed below the header
28 property alias text: textLabel.text
28 property alias text: textLabel.text
30− // This is the block of text displayed during an error
31− property alias errorText: errorLabel.text
33 // Whether animations are paused
30 // Whether animations are paused
34 property bool paused
31 property bool paused
@@ -46,7 +43,7 @@ Showable {
46 property alias foreground: foregroundExtra
43 property alias foreground: foregroundExtra
48 // The text label bottom, so you can position elements relative to it
45 // The text label bottom, so you can position elements relative to it
49− property real textBottom: textLabel.y + textLabel.height
46+ readonly property real textBottom: Math.max(textLabel.y + textLabel.height, errorTextLabel.y + errorTextLabel.height)
51 // The MouseArea that eats events (so you can adjust size as you will)
48 // The MouseArea that eats events (so you can adjust size as you will)
52 property alias mouseArea: mouseArea
49 property alias mouseArea: mouseArea
@@ -161,21 +158,41 @@ Showable {
161 font.pixelSize: units.gu(2.5)
158 font.pixelSize: units.gu(2.5)
161+ // We use two separate labels like this rather than just changing
162+ // the text of the above labels because we want to know where to place
163+ // sliders (via root.textBottom) without having that place change
164+ // as the text changes length.
165− id: errorLabel
166+ id: errorTitleLabel
166− objectName: "errorLabel"
167+ objectName: "errorTitleLabel"
167 anchors {
168 anchors {
168− top: parent.verticalCenter
169+ top: titleLabel.top
169− topMargin: d.verticalOffset + root.textYOffset
170− left: parent.left
170+ left: titleLabel.left
171− leftMargin: d.sideMargin + d.textXOffset
173− width: parent.width - d.sideMargin * 2
172+ width: titleLabel.width
174− horizontalAlignment: Text.AlignLeft
173+ horizontalAlignment: titleLabel.horizontalAlignment
175− wrapMode: Text.Wrap
174+ wrapMode: titleLabel.wrapMode
176− font.weight: Font.Light
175+ font.weight: titleLabel.font.weight
177− font.pixelSize: units.gu(3.5)
176+ font.pixelSize: titleLabel.font.pixelSize
178 opacity: 0
177 opacity: 0
178+ text: i18n.tr("You almost got it!")
183+ objectName: "errorTextLabel"
185+ top: errorTitleLabel.bottom
186+ topMargin: textLabel.anchors.topMargin
187+ left: textLabel.left
189+ width: textLabel.width
190+ horizontalAlignment: textLabel.horizontalAlignment
191+ wrapMode: textLabel.wrapMode
192+ font.weight: textLabel.font.weight
193+ font.pixelSize: textLabel.font.pixelSize
195+ text: i18n.tr("Try again.")
@@ -191,14 +208,14 @@ Showable {
191 when: errorTimer.running
208 when: errorTimer.running
192 PropertyChanges { target: titleLabel; opacity: 0 }
209 PropertyChanges { target: titleLabel; opacity: 0 }
193 PropertyChanges { target: textLabel; opacity: 0 }
210 PropertyChanges { target: textLabel; opacity: 0 }
194− PropertyChanges { target: errorLabel; opacity: 1 }
211+ PropertyChanges { target: errorTitleLabel; opacity: 1 }
212+ PropertyChanges { target: errorTextLabel; opacity: 1 }
197 transitions: Transition {
215 transitions: Transition {
198 to: "errorState"
216 to: "errorState"
199 reversible: true
217 reversible: true
200 SequentialAnimation {
218 SequentialAnimation {
201− id: showErrorAnimation
202 ParallelAnimation {
219 ParallelAnimation {
203 StandardAnimation {
220 StandardAnimation {
204 target: titleLabel
221 target: titleLabel
@@ -211,10 +228,17 @@ Showable {
211 duration: UbuntuAnimation.BriskDuration
228 duration: UbuntuAnimation.BriskDuration
214− StandardAnimation {
232+ StandardAnimation {
215− target: errorLabel
233+ target: errorTitleLabel
235+ duration: UbuntuAnimation.BriskDuration
238+ target: errorTextLabel
216− property: "opacity"
239+ property: "opacity"
217− duration: UbuntuAnimation.BriskDuration
240+ duration: UbuntuAnimation.BriskDuration