@@ -0,0 +1,142 @@
2+import Ubuntu.Components 0.1
9+ property real initialWidth: units.gu(5)
10+ property real initialHeight: units.gu(5)
12+ property alias sourceSize: image.sourceSize
13+ property alias fillMode: image.fillMode
14+ property alias asynchronous: image.asynchronous
15+ property alias cache: image.cache
16+ property alias horizontalAlignment: image.horizontalAlignment
17+ property alias verticalAlignment: image.verticalAlignment
22+ if (state === "ready") {
24+ image.nextSource = source;
26+ image.source = source;
37+ objectName: "activity"
38+ anchors.centerIn: parent
40+ visible: opacity != 0
47+ objectName: "errorImage"
48+ anchors.centerIn: parent
50+ visible: opacity != 0
52+ source: "graphics/close.png"
53+ sourceSize { width: units.gu(3); height: units.gu(3) }
62+ visible: opacity != 0
67+ property url nextSource
69+ fillMode: Image.PreserveAspectFit
72+ horizontalAlignment: Image.AlignHCenter
73+ verticalAlignment: Image.AlignVCenter
80+ when: image.source == ""
81+ PropertyChanges { target: root; implicitWidth: root.initialWidth; implicitHeight: root.initialHeight }
82+ PropertyChanges { target: errorImage; opacity: 0 }
87+ when: image.status === Image.Loading
88+ PropertyChanges { target: root; implicitWidth: root.initialWidth; implicitHeight: root.initialHeight }
89+ PropertyChanges { target: activity; opacity: 1 }
93+ when: image.status === Image.Ready && image.source != ""
94+ PropertyChanges { target: root; implicitWidth: image.width; implicitHeight: image.height }
95+ PropertyChanges { target: shape; opacity: 1 }
96+ PropertyChanges { target: placeholder; visible: false }
101+ when: image.status === Image.Error
102+ PropertyChanges { target: errorImage; opacity: 1.0 }
109+ SequentialAnimation {
110+ PropertyAction { target: shape; property: "visible" }
112+ NumberAnimation { target: shape; property: "opacity"; easing.type: Easing.Linear }
113+ UbuntuNumberAnimation { target: root; properties: "implicitWidth,implicitHeight" }
115+ PropertyAction { target: placeholder; property: "visible" }
121+ SequentialAnimation {
122+ PropertyAction { target: placeholder; property: "visible" }
124+ NumberAnimation { target: shape; property: "opacity"; easing.type: Easing.Linear }
126+ targets: [activity, errorImage]; property: "opacity";
127+ easing.type: Easing.Linear; duration: UbuntuAnimation.SnapDuration
129+ UbuntuNumberAnimation { target: root; properties: "implicitWidth,implicitHeight" }
131+ PropertyAction { target: shape; property: "visible" }
135+ if (!running && state === "default" && image.nextSource !== "") {
136+ image.source = image.nextSource;
137+ image.nextSource = "";