fix(StatusRoundedImage): actual loaded image width and height updated
In case you're dynamically change source image and image width and height are way bigger than the rounded image component width and height, resizing was not done correctly. update update
This commit is contained in:
parent
99f1634fbc
commit
76a0caaa13
|
@ -28,11 +28,19 @@ Rectangle {
|
||||||
id: image
|
id: image
|
||||||
width: statusRoundImage.width
|
width: statusRoundImage.width
|
||||||
height: statusRoundImage.height
|
height: statusRoundImage.height
|
||||||
sourceSize.width: parent.width * 2
|
|
||||||
sourceSize.height: parent.height * 2
|
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
cache: true
|
|
||||||
|
onSourceChanged: {
|
||||||
|
if (sourceSize.width < width || sourceSize.height < height) {
|
||||||
|
sourceSize = Qt.binding(function() {
|
||||||
|
return Qt.size(width * 2, height * 2)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sourceSize = undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
|
|
Loading…
Reference in New Issue