mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 14:44:13 -06:00
Setting the support extruder in recommended mode now correctly updates them in custom
CURA-3033
This commit is contained in:
parent
510c988c43
commit
6d66ea51ad
1 changed files with 29 additions and 4 deletions
|
@ -30,6 +30,7 @@ SettingItem
|
|||
textRole: "name"
|
||||
|
||||
anchors.fill: parent
|
||||
onCurrentIndexChanged: updateCurrentColor();
|
||||
|
||||
MouseArea
|
||||
{
|
||||
|
@ -115,12 +116,37 @@ SettingItem
|
|||
propertyProvider.setPropertyValue("value", extruders_model.getItem(index).index);
|
||||
control.color = extruders_model.getItem(index).color;
|
||||
}
|
||||
|
||||
onModelChanged: updateCurrentIndex();
|
||||
|
||||
Connections
|
||||
Binding
|
||||
{
|
||||
target: propertyProvider
|
||||
onPropertiesChanged: control.updateCurrentIndex();
|
||||
target: control
|
||||
property: "currentIndex"
|
||||
value:
|
||||
{
|
||||
for(var i = 0; i < extruders_model.rowCount(); ++i)
|
||||
{
|
||||
if(extruders_model.getItem(i).index == propertyProvider.properties.value)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// In some cases we want to update the current color without updating the currentIndex, so it's a seperate function.
|
||||
function updateCurrentColor()
|
||||
{
|
||||
for(var i = 0; i < extruders_model.rowCount(); ++i)
|
||||
{
|
||||
if(extruders_model.getItem(i).index == propertyProvider.properties.value)
|
||||
{
|
||||
control.color = extruders_model.getItem(i).color;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateCurrentIndex()
|
||||
|
@ -130,7 +156,6 @@ SettingItem
|
|||
if(extruders_model.getItem(i).index == propertyProvider.properties.value)
|
||||
{
|
||||
control.currentIndex = i;
|
||||
control.color = extruders_model.getItem(i).color;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue