Update mesh type dropdown when to reflect the selected object

This commit is contained in:
fieldOfView 2017-11-09 21:42:10 +01:00
parent 9c3e50c494
commit a1320939e8
2 changed files with 37 additions and 1 deletions

View file

@ -67,9 +67,32 @@ Item {
type: "cutting_mesh",
text: catalog.i18nc("@label", "Modify extruder or settings for overlap with other models")
});
meshTypeSelection.updateCurrentIndex();
}
}
function updateCurrentIndex()
{
var mesh_type = UM.ActiveTool.properties.getValue("MeshType");
for(var index=0; index < meshTypeSelection.model.count; index++)
{
if(meshTypeSelection.model.get(index).type == mesh_type)
{
meshTypeSelection.currentIndex = index;
return;
}
}
meshTypeSelection.currentIndex = 0;
}
}
Connections
{
target: UM.Selection
onSelectionChanged: meshTypeSelection.updateCurrentIndex()
}
}
Column