mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-10 07:15:03 -06:00
Make SidebarHeader use ExtrudersModel
This model is also used by the extruder selection drop-downs, and it's automatically filled already so that was double logic. Contributes to issues CURA-340 and CURA-1278.
This commit is contained in:
parent
2d998c127b
commit
7dbafa06d1
1 changed files with 4 additions and 25 deletions
|
@ -104,7 +104,7 @@ Item
|
|||
anchors.leftMargin: model.index * (extruderSelection.width / machineExtruderCount.properties.value)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: parent.width / machineExtruderCount.properties.value
|
||||
text: model.text
|
||||
text: model.name
|
||||
exclusiveGroup: extruderMenuGroup;
|
||||
checkable: true;
|
||||
checked: base.currentExtruderIndex == index
|
||||
|
@ -138,10 +138,11 @@ Item
|
|||
}
|
||||
}
|
||||
ExclusiveGroup { id: extruderMenuGroup; }
|
||||
ListView{
|
||||
ListView
|
||||
{
|
||||
id: extrudersList
|
||||
property var index: 0
|
||||
model: extrudersListModel
|
||||
model: Cura.ExtrudersModel {}
|
||||
delegate: wizardDelegate
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
|
@ -149,28 +150,6 @@ Item
|
|||
}
|
||||
}
|
||||
|
||||
ListModel
|
||||
{
|
||||
id: extrudersListModel
|
||||
Component.onCompleted: populateExtruderModel()
|
||||
}
|
||||
Connections
|
||||
{
|
||||
id: machineChange
|
||||
target: Cura.MachineManager
|
||||
onGlobalContainerChanged: populateExtruderModel()
|
||||
}
|
||||
|
||||
function populateExtruderModel()
|
||||
{
|
||||
extrudersListModel.clear();
|
||||
for(var extruder = 0; extruder < machineExtruderCount.properties.value ; extruder++) {
|
||||
extrudersListModel.append({
|
||||
text: catalog.i18nc("@label", "Extruder %1").arg(extruder + 1)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: variantRow
|
||||
anchors.top: extruderSelection.visible ? extruderSelection.bottom : machineSelectionRow.bottom
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue