parent
3d6bb8f52e
commit
77197040a4
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.13
|
import QtQuick 2.13
|
||||||
|
import QtQuick.Window 2.15
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\qmltype StatusImage
|
\qmltype StatusImage
|
||||||
|
@ -45,15 +46,5 @@ Image {
|
||||||
readonly property bool isError: status === Image.Error
|
readonly property bool isError: status === Image.Error
|
||||||
|
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
|
sourceSize: source.toString().endsWith(".svg") ? Qt.size(width, 0) : Qt.size(width * Screen.devicePixelRatio, 0)
|
||||||
onSourceChanged: {
|
|
||||||
// SVGs must have sourceSize, PNGs not; otherwise blurry
|
|
||||||
if (source.toString().endsWith(".svg"))
|
|
||||||
sourceSize = Qt.binding(() => Qt.size(width, height))
|
|
||||||
else if (sourceSize.width < width || sourceSize.height < height) {
|
|
||||||
sourceSize = Qt.binding(() => Qt.size(width * 2, height * 2))
|
|
||||||
} else {
|
|
||||||
sourceSize = undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue