on xenial help sign in
optimize
58bae58Michael Zanetti
Components/LazyImage.qml+1−6
@@ -52,9 +52,7 @@ Item {
52 id: placeholder
52 id: placeholder
53 objectName: "placeholder"
53 objectName: "placeholder"
54 color: "#22FFFFFF"
54 color: "#22FFFFFF"
55− width: shape.width
56− height: shape.height
57− anchors.centerIn: shape
55+ anchors.fill: shape
58 visible: opacity != 0
56 visible: opacity != 0
59
57
60 ActivityIndicator {
58 ActivityIndicator {
@@ -115,7 +113,6 @@ Item {
115 when: image.source == ""
113 when: image.source == ""
116 PropertyChanges { target: root; implicitWidth: root.initialWidth; implicitHeight: root.initialHeight }
114 PropertyChanges { target: root; implicitWidth: root.initialWidth; implicitHeight: root.initialHeight }
117 PropertyChanges { target: errorImage; opacity: 0 }
115 PropertyChanges { target: errorImage; opacity: 0 }
118− PropertyChanges { target: placeholder; width: root.initialWidth; height: root.initialHeight }
119 },
116 },
120 State {
117 State {
121 name: "loading"
118 name: "loading"
@@ -153,7 +150,6 @@ Item {
153 NumberAnimation { target: shape; property: "opacity"; easing.type: Easing.Linear }
150 NumberAnimation { target: shape; property: "opacity"; easing.type: Easing.Linear }
154 UbuntuNumberAnimation { target: root; properties: "implicitWidth,implicitHeight" }
151 UbuntuNumberAnimation { target: root; properties: "implicitWidth,implicitHeight" }
155 UbuntuNumberAnimation { target: shape; properties: "width,height" }
152 UbuntuNumberAnimation { target: shape; properties: "width,height" }
156− UbuntuNumberAnimation { target: placeholder; properties: "width,height" }
157 NumberAnimation {
153 NumberAnimation {
158 targets: [placeholder, activity, errorImage]; property: "opacity";
154 targets: [placeholder, activity, errorImage]; property: "opacity";
159 easing.type: Easing.Linear; duration: UbuntuAnimation.SnapDuration
155 easing.type: Easing.Linear; duration: UbuntuAnimation.SnapDuration
@@ -174,7 +170,6 @@ Item {
174 }
170 }
175 UbuntuNumberAnimation { target: root; properties: "implicitWidth,implicitHeight" }
171 UbuntuNumberAnimation { target: root; properties: "implicitWidth,implicitHeight" }
176 UbuntuNumberAnimation { target: shape; properties: "width,height" }
172 UbuntuNumberAnimation { target: shape; properties: "width,height" }
177− UbuntuNumberAnimation { target: placeholder; properties: "width,height" }
178 }
173 }
179 PropertyAction { target: shape; property: "visible" }
174 PropertyAction { target: shape; property: "visible" }
180 }
175 }