Use Flow for extruder boxes instead of GridLayout

Flow makes things a lot more simple with the double-width item at the bottom.

Contributes to issue CURA-3161.
This commit is contained in:
Ghostkeeper 2017-02-13 11:54:12 +01:00
parent adbcd874a8
commit 77f07bbc1d
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -67,27 +67,23 @@ Column
width: parent.width
height: childrenRect.height
GridLayout
Flow
{
id: extrudersGrid
columns: 2
columnSpacing: UM.Theme.getSize("sidebar_lining_thin").width
rowSpacing: UM.Theme.getSize("sidebar_lining_thin").height
spacing: UM.Theme.getSize("sidebar_lining_thin").width
width: parent.width
Repeater
{
id: extrudersRepeater
model: machineExtruderCount.properties.value
delegate: Rectangle
{
id: extruderRectangle
color: UM.Theme.getColor("sidebar")
width: extrudersGrid.width / 2 - UM.Theme.getSize("sidebar_lining_thin").width / 2
width: index == machineExtruderCount.properties.value - 1 && index % 2 == 0 ? extrudersGrid.width : extrudersGrid.width / 2 - UM.Theme.getSize("sidebar_lining_thin").width / 2
height: UM.Theme.getSize("sidebar_extruder_box").height
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.
{