@@ -27,6 +27,9 @@ Showable {
2727 // This is the block of text displayed below the header
2828 property alias text: textLabel.text
2929
30+ // This is the block of text displayed during an error
31+ property alias errorText: errorLabel.text
32+
3033 // Whether animations are paused
3134 property bool paused
3235
@@ -57,6 +60,10 @@ Showable {
5760
5861 signal finished()
5962
63+ function showError() {
64+ errorTimer.start();
65+ }
66+
6067 ////
6168
6269 shown: false
@@ -99,6 +106,11 @@ Showable {
99106 }
100107 }
101108
109+ Timer {
110+ id: errorTimer
111+ interval: 3500
112+ }
113+
102114 MouseArea { // eat any errant presses
103115 id: mouseArea
104116 anchors.fill: parent
@@ -128,7 +140,6 @@ Showable {
128140 wrapMode: Text.Wrap
129141 font.weight: Font.Light
130142 font.pixelSize: units.gu(3.5)
131− text: root.title
132143 }
133144
134145 Label {
@@ -144,7 +155,22 @@ Showable {
144155 wrapMode: Text.Wrap
145156 font.weight: Font.Light
146157 font.pixelSize: units.gu(2.5)
147− text: root.text
158+ }
159+
160+ Label {
161+ id: errorLabel
162+ anchors {
163+ top: parent.verticalCenter
164+ topMargin: d.verticalOffset + root.textYOffset
165+ left: parent.left
166+ leftMargin: d.sideMargin + d.textXOffset
167+ }
168+ width: parent.width - d.sideMargin * 2
169+ horizontalAlignment: Text.AlignLeft
170+ wrapMode: Text.Wrap
171+ font.weight: Font.Light
172+ font.pixelSize: units.gu(3.5)
173+ opacity: 0
148174 }
149175
150176 // A place for subclasses to add extra widgets
@@ -153,4 +179,37 @@ Showable {
153179 anchors.fill: parent
154180 }
155181 }
182+
183+ states: State {
184+ name: "errorState"
185+ when: errorTimer.running
186+ PropertyChanges { target: titleLabel; opacity: 0 }
187+ PropertyChanges { target: textLabel; opacity: 0 }
188+ PropertyChanges { target: errorLabel; opacity: 1 }
189+ }
190+
191+ transitions: Transition {
192+ to: "errorState"
193+ reversible: true
194+ SequentialAnimation {
195+ id: showErrorAnimation
196+ ParallelAnimation {
197+ StandardAnimation {
198+ target: titleLabel
199+ property: "opacity"
200+ duration: UbuntuAnimation.BriskDuration
201+ }
202+ StandardAnimation {
203+ target: textLabel
204+ property: "opacity"
205+ duration: UbuntuAnimation.BriskDuration
206+ }
207+ }
208+ StandardAnimation {
209+ target: errorLabel
210+ property: "opacity"
211+ duration: UbuntuAnimation.BriskDuration
212+ }
213+ }
214+ }
156215}