fix(Core): disable StatusIcon ColorOverlay if no color is supplied

This is needed to have the underlying SVG's color bleed through and
make use of the image's opacity at the same time.

Using `ColorOverlay` together with (half) transparent colors doesn't
work very well as it makes the underlying SVG color come through,
result in wrong colors.

Applying `opacity` on the image itself cause the `ColorOverlay` to
reduce in opacity as well. So in order to work with transparent
colors, we need a way to turn of the ColorOverlay and work with the
Image's opacity, which is what this change enables.
This commit is contained in:
Pascal Precht 2021-05-25 12:40:52 +02:00
parent 3ecf73ef58
commit f1e34e39b9
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ import QtGraphicalEffects 1.13
Image {
property string icon: ""
property color color
property color color: "transparent"
id: statusIcon
width: 24
@ -19,7 +19,7 @@ Image {
}
ColorOverlay {
visible: statusIcon.color !== undefined
visible: !Qt.colorEqual(statusIcon.color, "transparent")
anchors.fill: statusIcon
source: statusIcon
color: statusIcon.color