From d13b693da002ce24eabc8b7107aedede97d43556 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 31 Aug 2017 17:24:12 +0200 Subject: [PATCH] Hide icons if top bar buttons have no icon Otherwise there's some empty space there and the RecolourImage will colour that space white. Contributes to issue CURA-4213. --- resources/themes/cura/styles.qml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index 30e3ce9ab8..f96c2380c0 100755 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -156,22 +156,23 @@ QtObject { height: Theme.getSize("button_icon").height UM.RecolorImage { + visible: control.iconSource != "" id: icon color: UM.Theme.getColor("text_reversed") opacity: !control.enabled ? 0.2 : 1.0 source: control.iconSource - width: Theme.getSize("button_icon").width + width: visible ? Theme.getSize("button_icon").width : 0 height: Theme.getSize("button_icon").height sourceSize: Theme.getSize("button_icon") } UM.RecolorImage { - visible: control.overlayIconSource != "" + visible: control.overlayIconSource != "" && control.iconSource != "" color: control.overlayColor opacity: !control.enabled ? 0.2 : 1.0 source: control.overlayIconSource - width: Theme.getSize("button_icon").width + width: visible ? Theme.getSize("button_icon").width : 0 height: Theme.getSize("button_icon").height sourceSize: Theme.getSize("button_icon") @@ -180,7 +181,7 @@ QtObject { { text: control.text; anchors.left: icon.right - anchors.leftMargin: Theme.getSize("default_margin").width + anchors.leftMargin: icon.visible ? Theme.getSize("default_margin").width : 0 anchors.verticalCenter: parent.verticalCenter; font: UM.Theme.getFont("large"); color: UM.Theme.getColor("text_reversed")