@@ -34,6 +34,8 @@ Item {
34 property alias asynchronous: image.asynchronous
34 property alias asynchronous: image.asynchronous
35 property alias cache: image.cache
35 property alias cache: image.cache
36 property alias sourceImage: image
36 property alias sourceImage: image
38+ property bool useUbuntuShape: true
37 property bool pressed: false
39 property bool pressed: false
39 state: "default"
41 state: "default"
@@ -47,12 +49,15 @@ Item {
50− UbuntuShape {
52+ Loader {
51 id: placeholder
53 id: placeholder
52 objectName: "placeholder"
54 objectName: "placeholder"
53− backgroundColor: "#22FFFFFF"
54 anchors.fill: shape
55 anchors.fill: shape
56+ active: useUbuntuShape
55 visible: opacity != 0
57 visible: opacity != 0
58+ sourceComponent: UbuntuShape {
59+ backgroundColor: "#22FFFFFF"
57 ActivityIndicator {
62 ActivityIndicator {
58 id: activity
63 id: activity
@@ -75,27 +80,35 @@ Item {
78− UbuntuShapeOverlay {
83+ Loader {
80 objectName: "shape"
85 objectName: "shape"
81 height: root.initialHeight
86 height: root.initialHeight
82 width: root.initialWidth
87 width: root.initialWidth
83 anchors.centerIn: root.scaleTo == "fit" ? parent : undefined
88 anchors.centerIn: root.scaleTo == "fit" ? parent : undefined
84−
89+ active: useUbuntuShape
85 opacity: 0
90 opacity: 0
86 visible: opacity != 0
91 visible: opacity != 0
92+ sourceComponent: UbuntuShapeOverlay {
93+ property bool pressed: false
87− overlayColor: Qt.rgba(0, 0, 0, root.pressed ? 0.1 : 0)
94+ overlayColor: Qt.rgba(0, 0, 0, pressed ? 0.1 : 0)
88− overlayRect: Qt.rect(0.0, 0.0, 1.0, 1.0)
95+ overlayRect: Qt.rect(0.0, 0.0, 1.0, 1.0)
89− sourceFillMode: UbuntuShape.PreserveAspectCrop
96+ }
90− sourceHorizontalAlignment: UbuntuShape.AlignHCenter
97+ onLoaded: {
91− sourceVerticalAlignment: UbuntuShape.AlignVCenter
98+ item.source = image;
99+ item.pressed = Qt.binding(function() { return root.pressed; });
92− source: Image {
102+ Image {
93 id: image
103 id: image
94 objectName: "image"
104 objectName: "image"
96 property url nextSource
106 property url nextSource
97 property string format: image.implicitWidth > image.implicitHeight ? "landscape" : "portrait"
107 property string format: image.implicitWidth > image.implicitHeight ? "landscape" : "portrait"
109+ anchors.fill: parent
110+ visible: !useUbuntuShape
111+ fillMode: Image.PreserveAspectFit
99 asynchronous: true
112 asynchronous: true
100 cache: false
113 cache: false
101 sourceSize.width: root.scaleTo == "width" ? root.width
114 sourceSize.width: root.scaleTo == "width" ? root.width