Fix circular dependency with tab index and active stack

Only when actually clicking the tab should it change the active extruder index; not when the current index is changed for any other reason.
Next up: Don't change the current index for any other reason.

Contributes to issue CURA-5876.
This commit is contained in:
Ghostkeeper 2018-11-30 14:53:10 +01:00
parent 4e2f51e7e8
commit e93bbf07a4
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -35,7 +35,7 @@ Item
anchors.top: header.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height
onCurrentIndexChanged: Cura.ExtruderManager.setActiveExtruderIndex(currentIndex)
currentIndex: Math.max(Cura.ExtruderManager.activeExtruderIndex, 0)
Repeater
{
@ -53,6 +53,10 @@ Item
height: parent.height
}
}
onClicked:
{
Cura.ExtruderManager.setActiveExtruderIndex(tabBar.currentIndex)
}
}
}
}