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:
Lukáš Tinkl 2022-07-06 11:31:05 +02:00 committed by Michał Cieślak
parent 9a076ee49c
commit dd38cfc0de
1 changed files with 3 additions and 7 deletions

View File

@ -8,23 +8,19 @@ Image {
id: statusIcon
width: 24
height: 24
sourceSize.width: width
sourceSize.height: height
// SVGs must have sourceSize, PNGs not; otherwise blurry
sourceSize: !!icon ? Qt.size(width, height) : undefined
fillMode: Image.PreserveAspectFit
antialiasing: true
mipmap: true
onIconChanged: {
if (icon !== "") {
source = "../../assets/img/icons/" + icon + ".svg";
}
}
layer.mipmap: true
layer.smooth: true
layer.format: ShaderEffectSource.RGBA
layer.enabled:!Qt.colorEqual(statusIcon.color, "transparent")
layer.enabled: !Qt.colorEqual(statusIcon.color, "transparent")
layer.effect: ColorOverlay {
color: statusIcon.color
}