2
0
mirror of synced 2025-02-18 01:26:41 +00:00

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 ee800269fd
commit 72592afffd
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D

View File

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