mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 21:13:58 -06:00
Re-use repeater count instead of listening to machineExtruderCount everywhere
Might be slightly more efficient and/or update stuff in the correct order. Contributes to issue CURA-3161.
This commit is contained in:
parent
a3170041f8
commit
2722ac5a8f
1 changed files with 5 additions and 4 deletions
|
@ -77,6 +77,7 @@ Column
|
|||
|
||||
Repeater
|
||||
{
|
||||
id: extrudersRepeater
|
||||
model: machineExtruderCount.properties.value
|
||||
delegate: Rectangle
|
||||
{
|
||||
|
@ -84,13 +85,13 @@ Column
|
|||
color: UM.Theme.getColor("sidebar")
|
||||
width: extrudersGrid.width / 2 - UM.Theme.getSize("sidebar_lining_thin").width / 2
|
||||
height: UM.Theme.getSize("sidebar_extruder_box").height
|
||||
Layout.fillWidth: index == machineExtruderCount.properties.value - 1 && index % 2 == 0
|
||||
anchors.right: (index == machineExtruderCount.properties.value - 1 && index % 2 == 0) ? parent.right : undefined
|
||||
anchors.left: (index == machineExtruderCount.properties.value - 1 && index % 2 == 0) ? parent.left : undefined
|
||||
Layout.fillWidth: index == extrudersRepeater.count - 1 && index % 2 == 0
|
||||
anchors.right: (index == extrudersRepeater.count - 1 && index % 2 == 0) ? parent.right : undefined
|
||||
anchors.left: (index == extrudersRepeater.count - 1 && index % 2 == 0) ? parent.left : undefined
|
||||
|
||||
Label //Extruder name.
|
||||
{
|
||||
text: (machineExtruderCount.properties.value > 1 && extrudersModel.getItem(index).name != null) ? extrudersModel.getItem(index).name : catalog.i18nc("@label", "Hotend")
|
||||
text: (extrudersRepeater.count > 1 && extrudersModel.getItem(index).name != null) ? extrudersModel.getItem(index).name : catalog.i18nc("@label", "Hotend")
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("default")
|
||||
anchors.left: parent.left
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue