Don't hide tab bar when disabling all but one extruder

And make sure the checkbox for enabling also disappears.
We don't want to make this dependent on the number of enabled extruders, but on the total number of extruders. This way you can actually re-enable an extruder again because the tab bar shouldn't disappear.

Contributes to issue CURA-5876.
This commit is contained in:
Ghostkeeper 2018-12-03 11:19:25 +01:00
parent 6012ea0b9e
commit af747ae09c
No known key found for this signature in database
GPG Key ID: 86BEF881AE2CF276

View File

@ -40,7 +40,7 @@ Item
id: tabBar id: tabBar
anchors.top: header.bottom anchors.top: header.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.topMargin: UM.Theme.getSize("default_margin").height
visible: Cura.MachineManager.numberExtrudersEnabled > 1 visible: extrudersModel.count > 1
currentIndex: Math.max(Cura.ExtruderManager.activeExtruderIndex, 0) currentIndex: Math.max(Cura.ExtruderManager.activeExtruderIndex, 0)
@ -138,6 +138,7 @@ Item
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
height: parent.height height: parent.height
width: selectors.textWidth width: selectors.textWidth
visible: extrudersModel.count > 1
} }
OldControls.CheckBox OldControls.CheckBox
@ -146,6 +147,7 @@ Item
enabled: !checked || Cura.MachineManager.numberExtrudersEnabled > 1 //Disable if it's the last enabled extruder. enabled: !checked || Cura.MachineManager.numberExtrudersEnabled > 1 //Disable if it's the last enabled extruder.
height: UM.Theme.getSize("setting_control").height height: UM.Theme.getSize("setting_control").height
style: UM.Theme.styles.checkbox style: UM.Theme.styles.checkbox
visible: extrudersModel.count > 1
/* Use a MouseArea to process the click on this checkbox. /* Use a MouseArea to process the click on this checkbox.
This is necessary because actually clicking the checkbox This is necessary because actually clicking the checkbox