From 9e7a52e28bd783876ae8255fc3648f4dbb7fcc4e Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 09:43:50 +0100 Subject: [PATCH] Update the background color for the expandable component when using the close button. Contributes to CURA-5941. --- resources/qml/ExpandableComponent.qml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index 3a03740251..4170a0942e 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -71,7 +71,15 @@ Item function toggleContent() { - content.visible = !content.visible + content.visible = !expanded + } + + // Add this binding since the background color is not updated otherwise + Binding + { + target: background + property: "color" + value: expanded ? headerActiveColor : headerBackgroundColor } implicitHeight: 100 * screenScaleFactor @@ -82,7 +90,7 @@ Item id: background property real padding: UM.Theme.getSize("default_margin").width - color: headerBackgroundColor + color: expanded ? headerActiveColor : headerBackgroundColor anchors.fill: parent Loader