@@ -34,6 +34,8 @@ Item {
3434 property alias asynchronous: image.asynchronous
3535 property alias cache: image.cache
3636 property alias sourceImage: image
37+
38+ property bool useUbuntuShape: true
3739 property bool pressed: false
3840
3941 state: "default"
@@ -47,12 +49,15 @@ Item {
4749 }
4850 }
4951
50− UbuntuShape {
52+ Loader {
5153 id: placeholder
5254 objectName: "placeholder"
53− backgroundColor: "#22FFFFFF"
5455 anchors.fill: shape
56+ active: useUbuntuShape
5557 visible: opacity != 0
58+ sourceComponent: UbuntuShape {
59+ backgroundColor: "#22FFFFFF"
60+ }
5661
5762 ActivityIndicator {
5863 id: activity
@@ -75,27 +80,35 @@ Item {
7580 }
7681 }
7782
78− UbuntuShapeOverlay {
83+ Loader {
7984 id: shape
8085 objectName: "shape"
8186 height: root.initialHeight
8287 width: root.initialWidth
8388 anchors.centerIn: root.scaleTo == "fit" ? parent : undefined
84−
89+ active: useUbuntuShape
8590 opacity: 0
8691 visible: opacity != 0
87− overlayColor: Qt.rgba(0, 0, 0, root.pressed ? 0.1 : 0)
88− overlayRect: Qt.rect(0.0, 0.0, 1.0, 1.0)
89− sourceFillMode: UbuntuShape.PreserveAspectCrop
90− sourceHorizontalAlignment: UbuntuShape.AlignHCenter
91− sourceVerticalAlignment: UbuntuShape.AlignVCenter
92− source: Image {
92+ sourceComponent: UbuntuShapeOverlay {
93+ property bool pressed: false
94+ overlayColor: Qt.rgba(0, 0, 0, pressed ? 0.1 : 0)
95+ overlayRect: Qt.rect(0.0, 0.0, 1.0, 1.0)
96+ }
97+ onLoaded: {
98+ item.source = image;
99+ item.pressed = Qt.binding(function() { return root.pressed; });
100+ }
101+
102+ Image {
93103 id: image
94104 objectName: "image"
95105
96106 property url nextSource
97107 property string format: image.implicitWidth > image.implicitHeight ? "landscape" : "portrait"
98108
109+ anchors.fill: parent
110+ visible: !useUbuntuShape
111+ fillMode: Image.PreserveAspectFit
99112 asynchronous: true
100113 cache: false
101114 sourceSize.width: root.scaleTo == "width" ? root.width