Merge pull request #5338 from Ultimaker/CURA-6232_config_menu_tab_fix

Fix tab-bar of config.-menu always on idex 0 on reshow. [CURA-6232]
This commit is contained in:
Lipu Fei 2019-02-22 13:37:10 +01:00 committed by GitHub
commit 2694ef98e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -124,6 +124,15 @@ Item
}
}
// Can't use 'item: ...activeExtruderIndex' directly apparently, see also the comment on the previous block.
onVisibleChanged:
{
if (tabBar.visible)
{
tabBar.setCurrentIndex(Cura.ExtruderManager.activeExtruderIndex);
}
}
//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.