From 1e699604642f69dda88185a382cae0f657580d93 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 6 Dec 2018 13:52:57 +0100 Subject: [PATCH] Make it possible to disable ExpandableComponent It won't show the drop-down icon then, won't do hovers and won't allow you to click on it. This will not remove the contents of the ExpandableComponent menu bar item though, so that has to be done in ConfigurationMenu.qml. Contributes to issue CURA-5876. --- resources/qml/ExpandableComponent.qml | 4 +++- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index 9bedaa940c..e42aa7e4a1 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -32,6 +32,8 @@ Item property color headerBackgroundColor: UM.Theme.getColor("action_button") property color headerHoverColor: UM.Theme.getColor("action_button_hovered") + property alias enabled: mouseArea.enabled + // Defines the alignment of the popup with respect of the headerItem, by default to the right property int popupAlignment: ExpandableComponent.PopupAlignment.AlignRight @@ -139,7 +141,7 @@ Item verticalCenter: parent.verticalCenter margins: background.padding } - visible: source != "" + visible: source != "" && base.enabled width: height height: Math.round(0.2 * base.height) color: UM.Theme.getColor("text") diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index f81176ab1a..c4671d3a3a 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -45,6 +45,7 @@ Cura.ExpandableComponent orientation: ListView.Horizontal anchors.fill: parent model: extrudersModel + visible: base.enabled delegate: Item {