mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 09:47:50 -06:00
ExtruderIcon will now display that it's disabled correctly
CURA-5785
This commit is contained in:
parent
d661a8e626
commit
7f99ed1af3
4 changed files with 24 additions and 6 deletions
|
@ -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"]
|
||||
|
|
|
@ -23,6 +23,7 @@ Button
|
|||
{
|
||||
width: UM.Theme.getSize("button_icon").width
|
||||
materialColor: model.color
|
||||
extruderEnabled: extruder.stack.isEnabled
|
||||
property int index: extruder.index
|
||||
}
|
||||
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue