diff --git a/cura/Settings/ExtrudersModel.py b/cura/Settings/ExtrudersModel.py index 9b85afa10e..14a8dadc69 100644 --- a/cura/Settings/ExtrudersModel.py +++ b/cura/Settings/ExtrudersModel.py @@ -24,8 +24,6 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel): ## Human-readable name of the extruder. NameRole = Qt.UserRole + 2 - ## Is the extruder enabled? - EnabledRole = Qt.UserRole + 9 ## Colour of the material loaded in the extruder. ColorRole = Qt.UserRole + 3 @@ -50,6 +48,9 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel): MaterialBrandRole = Qt.UserRole + 9 ColorNameRole = Qt.UserRole + 10 + ## Is the extruder enabled? + EnabledRole = Qt.UserRole + 11 + ## List of colours to display if there is no material or the material has no known # colour. defaultColors = ["#ffc924", "#86ec21", "#22eeee", "#245bff", "#9124ff", "#ff24c8"] diff --git a/resources/qml/ExtruderButton.qml b/resources/qml/ExtruderButton.qml index 764e9c94cb..8a1f0af44a 100644 --- a/resources/qml/ExtruderButton.qml +++ b/resources/qml/ExtruderButton.qml @@ -23,6 +23,7 @@ Button { width: UM.Theme.getSize("button_icon").width materialColor: model.color + extruderEnabled: extruder.stack.isEnabled property int index: extruder.index } diff --git a/resources/qml/ExtruderIcon.qml b/resources/qml/ExtruderIcon.qml index eb4bdef0f7..87e210e75a 100644 --- a/resources/qml/ExtruderIcon.qml +++ b/resources/qml/ExtruderIcon.qml @@ -13,9 +13,9 @@ Item implicitHeight: implicitWidth property bool checked: true - property alias materialColor: mainIcon.color + property color materialColor property alias textColor: extruderNumberText.color - + property bool extruderEnabled: true UM.RecolorImage { id: mainIcon @@ -24,6 +24,7 @@ Item sourceSize.width: parent.width sourceSize.height: parent.width source: UM.Theme.getIcon("extruder_button") + color: extruderEnabled ? materialColor: "gray" } Rectangle @@ -31,9 +32,9 @@ Item id: extruderNumberCircle width: height - height: parent.height / 2 + height: Math.round(parent.height / 2) radius: Math.round(width / 2) - color: "white" + color: UM.Theme.getColor("toolbar_background") anchors { @@ -51,6 +52,19 @@ Item font: UM.Theme.getFont("default") width: contentWidth height: contentHeight + visible: extruderEnabled + } + + UM.RecolorImage + { + id: disabledIcon + anchors.fill: parent + anchors.margins: UM.Theme.getSize("thick_lining").width + sourceSize.width: width + sourceSize.height: width + source: UM.Theme.getIcon("cross1") + visible: !extruderEnabled + color: "black" } } } \ No newline at end of file diff --git a/resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml b/resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml index b1058ce627..c157b0b24f 100644 --- a/resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml +++ b/resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml @@ -49,6 +49,7 @@ Cura.ExpandableComponent { id: extruderIcon materialColor: model.color + extruderEnabled: model.enabled height: parent.height width: height } @@ -118,6 +119,7 @@ Cura.ExpandableComponent { anchors.horizontalCenter: parent.horizontalCenter materialColor: model.color + extruderEnabled: model.enabled width: parent.height height: parent.height }