From f1e34e39b9f6a6e2987367b1c4c02a3ae458bdb7 Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Tue, 25 May 2021 12:40:52 +0200 Subject: [PATCH] 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. --- src/StatusQ/Core/StatusIcon.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/StatusQ/Core/StatusIcon.qml b/src/StatusQ/Core/StatusIcon.qml index 6e3100b1..e0eb89da 100644 --- a/src/StatusQ/Core/StatusIcon.qml +++ b/src/StatusQ/Core/StatusIcon.qml @@ -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