mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 16:29:01 +08:00
Reset tab index when repeater's model is rebuilt
We can't prevent the model from being rebuilt. At least, not without a major refactor. Contributes to issue CURA-5876.
This commit is contained in:
parent
e93bbf07a4
commit
1d9a13cac2
@ -39,6 +39,7 @@ Item
|
|||||||
|
|
||||||
Repeater
|
Repeater
|
||||||
{
|
{
|
||||||
|
id: repeater
|
||||||
model: extrudersModel
|
model: extrudersModel
|
||||||
delegate: UM.TabRowButton
|
delegate: UM.TabRowButton
|
||||||
{
|
{
|
||||||
@ -59,6 +60,18 @@ Item
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//When the model of the extruders is rebuilt, the list of extruders is briefly emptied and rebuilt.
|
||||||
|
//This causes the currentIndex of the tab to be in an invalid position which resets it to 0.
|
||||||
|
//Therefore we need to change it back to what it was: The active extruder index.
|
||||||
|
Connections
|
||||||
|
{
|
||||||
|
target: repeater.model
|
||||||
|
onModelChanged:
|
||||||
|
{
|
||||||
|
tabBar.currentIndex = Math.max(Cura.ExtruderManager.activeExtruderIndex, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
|
Loading…
x
Reference in New Issue
Block a user