mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 18:45:55 +08: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
@ -77,6 +77,7 @@ Column
|
|||||||
|
|
||||||
Repeater
|
Repeater
|
||||||
{
|
{
|
||||||
|
id: extrudersRepeater
|
||||||
model: machineExtruderCount.properties.value
|
model: machineExtruderCount.properties.value
|
||||||
delegate: Rectangle
|
delegate: Rectangle
|
||||||
{
|
{
|
||||||
@ -84,13 +85,13 @@ Column
|
|||||||
color: UM.Theme.getColor("sidebar")
|
color: UM.Theme.getColor("sidebar")
|
||||||
width: extrudersGrid.width / 2 - UM.Theme.getSize("sidebar_lining_thin").width / 2
|
width: extrudersGrid.width / 2 - UM.Theme.getSize("sidebar_lining_thin").width / 2
|
||||||
height: UM.Theme.getSize("sidebar_extruder_box").height
|
height: UM.Theme.getSize("sidebar_extruder_box").height
|
||||||
Layout.fillWidth: index == machineExtruderCount.properties.value - 1 && index % 2 == 0
|
Layout.fillWidth: index == extrudersRepeater.count - 1 && index % 2 == 0
|
||||||
anchors.right: (index == machineExtruderCount.properties.value - 1 && index % 2 == 0) ? parent.right : undefined
|
anchors.right: (index == extrudersRepeater.count - 1 && index % 2 == 0) ? parent.right : undefined
|
||||||
anchors.left: (index == machineExtruderCount.properties.value - 1 && index % 2 == 0) ? parent.left : undefined
|
anchors.left: (index == extrudersRepeater.count - 1 && index % 2 == 0) ? parent.left : undefined
|
||||||
|
|
||||||
Label //Extruder name.
|
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")
|
color: UM.Theme.getColor("text")
|
||||||
font: UM.Theme.getFont("default")
|
font: UM.Theme.getFont("default")
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
Loading…
x
Reference in New Issue
Block a user