Fix hiding extruder selection when switching to a signle extrusion printer

CURA-2207
This commit is contained in:
fieldOfView 2016-08-30 14:08:29 +02:00
parent 7aa44bdd9e
commit 4593e8615e

View file

@ -42,15 +42,13 @@ Item {
{ {
id: extruderSelector id: extruderSelector
model: Cura.ExtrudersModel model: Cura.extruders_model
{ {
id: extruders_model id: extruders_model
onRowsInserted: extruderSelector.visible = extruders_model.rowCount() > 1
onModelReset: extruderSelector.visible = extruders_model.rowCount() > 1
onModelChanged: extruderSelector.color = extruders_model.getItem(extruderSelector.currentIndex).color onModelChanged: extruderSelector.color = extruders_model.getItem(extruderSelector.currentIndex).color
} }
property string color: extruders_model.getItem(extruderSelector.currentIndex).color property string color: extruders_model.getItem(extruderSelector.currentIndex).color
visible: extruders_model.rowCount() > 1 visible: machineExtruderCount.properties.value > 1
textRole: "name" textRole: "name"
width: UM.Theme.getSize("setting_control").width width: UM.Theme.getSize("setting_control").width
height: UM.Theme.getSize("section").height height: UM.Theme.getSize("section").height
@ -430,6 +428,16 @@ Item {
] ]
} }
UM.SettingPropertyProvider
{
id: machineExtruderCount
containerStackId: Cura.MachineManager.activeMachineId
key: "machine_extruder_count"
watchedProperties: [ "value" ]
storeIndex: 0
}
SystemPalette { id: palette; } SystemPalette { id: palette; }
Component Component