mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 23:25:53 +08:00
Finally got edge cases regarding recommended mode support extruder color working. CURA-2767
This commit is contained in:
parent
23f7a91b40
commit
14701d89d0
@ -290,9 +290,18 @@ Item
|
|||||||
id: supportExtruderCombobox
|
id: supportExtruderCombobox
|
||||||
visible: (supportEnabled.properties.value == "True") && (machineExtruderCount.properties.value > 1)
|
visible: (supportEnabled.properties.value == "True") && (machineExtruderCount.properties.value > 1)
|
||||||
model: extruderModel
|
model: extruderModel
|
||||||
property string color:
|
|
||||||
|
property string color_override: "" // for manually setting values
|
||||||
|
property string color: // is evaluated automatically, but the first time is before extruderModel being filled
|
||||||
{
|
{
|
||||||
var model_color = extruderModel.get(currentIndex).color;
|
CuraApplication.log(" normal color evaluation");
|
||||||
|
|
||||||
|
var current_extruder = extruderModel.get(currentIndex);
|
||||||
|
color_override = "";
|
||||||
|
if (current_extruder === undefined) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
var model_color = current_extruder.color;
|
||||||
return (model_color) ? model_color : "";
|
return (model_color) ? model_color : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,7 +339,7 @@ Item
|
|||||||
enabled: base.settingsEnabled
|
enabled: base.settingsEnabled
|
||||||
property alias _hovered: supportExtruderMouseArea.containsMouse
|
property alias _hovered: supportExtruderMouseArea.containsMouse
|
||||||
|
|
||||||
currentIndex: parseFloat(supportExtruderNr.properties.value)
|
currentIndex: parseFloat(supportExtruderNr.properties.value)q
|
||||||
onActivated:
|
onActivated:
|
||||||
{
|
{
|
||||||
// Send the extruder nr as a string.
|
// Send the extruder nr as a string.
|
||||||
@ -354,7 +363,13 @@ Item
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// color rectangle
|
function updateCurrentColor()
|
||||||
|
{
|
||||||
|
var current_extruder = extruderModel.get(currentIndex);
|
||||||
|
if (current_extruder !== undefined) {
|
||||||
|
supportExtruderCombobox.color_override = current_extruder.color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -444,6 +459,7 @@ Item
|
|||||||
color: extruders.getItem(extruderNumber).color
|
color: extruders.getItem(extruderNumber).color
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
supportExtruderCombobox.updateCurrentColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
|
@ -446,7 +446,7 @@ QtObject {
|
|||||||
anchors.leftMargin: UM.Theme.getSize("default_lining").width
|
anchors.leftMargin: UM.Theme.getSize("default_lining").width
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
color: control.color
|
color: if (control.color_override != "") {return control.color_override} else {return control.color;}
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : UM.Theme.getColor("setting_control_border")
|
border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : UM.Theme.getColor("setting_control_border")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user