fix(StatusIcon): flag/currency icons are rendered blurred
- set the Image's sourceSize only if it's an SVG, otherwise it is rendered blurry - remove antialiasing/mipmap; it's not the correct fix, doesn't really improve the visual quality for smallish items like icons and just causes memory/GPU overhead
This commit is contained in:
parent
9a076ee49c
commit
dd38cfc0de
|
@ -8,23 +8,19 @@ Image {
|
||||||
id: statusIcon
|
id: statusIcon
|
||||||
width: 24
|
width: 24
|
||||||
height: 24
|
height: 24
|
||||||
sourceSize.width: width
|
// SVGs must have sourceSize, PNGs not; otherwise blurry
|
||||||
sourceSize.height: height
|
sourceSize: !!icon ? Qt.size(width, height) : undefined
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
|
|
||||||
antialiasing: true
|
|
||||||
mipmap: true
|
|
||||||
|
|
||||||
onIconChanged: {
|
onIconChanged: {
|
||||||
if (icon !== "") {
|
if (icon !== "") {
|
||||||
source = "../../assets/img/icons/" + icon + ".svg";
|
source = "../../assets/img/icons/" + icon + ".svg";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
layer.mipmap: true
|
|
||||||
layer.smooth: true
|
layer.smooth: true
|
||||||
layer.format: ShaderEffectSource.RGBA
|
layer.format: ShaderEffectSource.RGBA
|
||||||
layer.enabled:!Qt.colorEqual(statusIcon.color, "transparent")
|
layer.enabled: !Qt.colorEqual(statusIcon.color, "transparent")
|
||||||
layer.effect: ColorOverlay {
|
layer.effect: ColorOverlay {
|
||||||
color: statusIcon.color
|
color: statusIcon.color
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue