mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 18:05:55 +08:00
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:
parent
adbcd874a8
commit
77f07bbc1d
@ -67,27 +67,23 @@ Column
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
|
|
||||||
GridLayout
|
Flow
|
||||||
{
|
{
|
||||||
id: extrudersGrid
|
id: extrudersGrid
|
||||||
columns: 2
|
spacing: UM.Theme.getSize("sidebar_lining_thin").width
|
||||||
columnSpacing: UM.Theme.getSize("sidebar_lining_thin").width
|
|
||||||
rowSpacing: UM.Theme.getSize("sidebar_lining_thin").height
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
Repeater
|
Repeater
|
||||||
{
|
{
|
||||||
id: extrudersRepeater
|
id: extrudersRepeater
|
||||||
model: machineExtruderCount.properties.value
|
model: machineExtruderCount.properties.value
|
||||||
|
|
||||||
delegate: Rectangle
|
delegate: Rectangle
|
||||||
{
|
{
|
||||||
id: extruderRectangle
|
id: extruderRectangle
|
||||||
color: UM.Theme.getColor("sidebar")
|
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
|
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.
|
Label //Extruder name.
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user