mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Select newly created material
This commit is contained in:
parent
f3c2df3ab4
commit
00f3cf409b
1 changed files with 6 additions and 2 deletions
|
@ -91,9 +91,11 @@ UM.ManagementPage
|
|||
}
|
||||
|
||||
activeId: Cura.MachineManager.activeMaterialId
|
||||
activeIndex: {
|
||||
activeIndex: getIndexById(activeId)
|
||||
function getIndexById(material_id)
|
||||
{
|
||||
for(var i = 0; i < model.rowCount(); i++) {
|
||||
if (model.getItem(i).id == Cura.MachineManager.activeMaterialId) {
|
||||
if (model.getItem(i).id == material_id) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
@ -149,6 +151,7 @@ UM.ManagementPage
|
|||
{
|
||||
Cura.MachineManager.setActiveMaterial(material_id)
|
||||
}
|
||||
base.objectList.currentIndex = base.getIndexById(material_id);
|
||||
}
|
||||
},
|
||||
Button
|
||||
|
@ -169,6 +172,7 @@ UM.ManagementPage
|
|||
{
|
||||
Cura.MachineManager.setActiveMaterial(material_id)
|
||||
}
|
||||
base.objectList.currentIndex = base.getIndexById(material_id);
|
||||
}
|
||||
},
|
||||
Button
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue