mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-10 07:15:03 -06:00
Select the activated material when material management page shows up
CURA-4606
This commit is contained in:
parent
27b3a71a98
commit
ff0d694e72
1 changed files with 18 additions and 0 deletions
|
@ -52,6 +52,24 @@ Item
|
|||
return base.currentItem.root_material_id == root_material_id;
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
// Select the activated material when this page shows up
|
||||
const extruder_position = Cura.ExtruderManager.activeExtruderIndex;
|
||||
const active_root_material_id = Cura.MachineManager.currentRootMaterialId[extruder_position];
|
||||
var itemIndex = -1;
|
||||
for (var i = 0; i < materialsModel.rowCount(); ++i)
|
||||
{
|
||||
var item = materialsModel.getItem(i);
|
||||
if (item.root_material_id == active_root_material_id)
|
||||
{
|
||||
itemIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
materialListView.currentIndex = itemIndex;
|
||||
}
|
||||
|
||||
Row // Button Row
|
||||
{
|
||||
id: buttonRow
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue