fix: blurry icons in Network Filter combobox

- detect SVG images and apply the same fix as we do in StatusIcon
- do not load a lowres (tiny) variant

Fixes #9853
This commit is contained in:
Lukáš Tinkl 2023-05-29 17:11:40 +02:00 committed by Lukáš Tinkl
parent 8ae48d9181
commit 130976957f
2 changed files with 8 additions and 5 deletions

View File

@ -27,7 +27,7 @@ Image {
id: root
/*!
\qmlproperty bool StatusAnimatedImage::isLoading
\qmlproperty bool StatusImage::isLoading
\c true when the image is currently being loaded (status === Image.Loading).
\c false otherwise.
@ -35,7 +35,7 @@ Image {
*/
readonly property bool isLoading: status === Image.Loading
/*!
\qmlproperty bool StatusAnimatedImage::isError
\qmlproperty bool StatusImage::isError
\c true when an error occurred while loading the image (status === Image.Error).
\c false otherwise.
@ -47,7 +47,10 @@ Image {
fillMode: Image.PreserveAspectFit
onSourceChanged: {
if (sourceSize.width < width || sourceSize.height < height) {
// 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

View File

@ -31,7 +31,7 @@ StatusComboBox {
property string selectedChainName: ""
property string selectedIconUrl: ""
property bool allSelected: root.enabledNetworks.count === root.allNetworks.count
readonly property bool allSelected: root.enabledNetworks.count === root.allNetworks.count
// Persist selection between selectPopupLoader reloads
property var currentModel: layer1Networks
@ -97,7 +97,7 @@ StatusComboBox {
visible: image.source !== ""
border.width: index === 0 ? 0 : 1
border.color: Theme.palette.white
image.source: Style.svg("tiny/" + model.iconUrl)
image.source: Style.svg(model.iconUrl)
z: index + 1
}
}