Add grey border between extruder boxes

This is done by fitting tightly a rectangle around the grid of boxes. The boxes themselves have a white background but there is spacing between the boxes, which results in the little border.

Contributes to issue CURA-3161.
This commit is contained in:
Ghostkeeper 2017-02-03 13:54:37 +01:00
parent 9546c85967
commit 687cdcc30e
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -68,41 +68,48 @@ Column
}
}
GridLayout
Rectangle
{
id: extrudersGrid
columns: 2
columnSpacing: UM.Theme.getSize("sidebar_lining_thin").width
rowSpacing: UM.Theme.getSize("sidebar_lining_thin").height
color: UM.Theme.getColor("sidebar_lining")
width: parent.width
height: childrenRect.height
Repeater
GridLayout
{
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
height: UM.Theme.getSize("sidebar_extruder_box").height
id: extrudersGrid
columns: 2
columnSpacing: UM.Theme.getSize("sidebar_lining_thin").width
rowSpacing: UM.Theme.getSize("sidebar_lining_thin").height
width: parent.width
Text //Extruder name.
Repeater
{
model: machineExtruderCount.properties.value
delegate: Rectangle
{
text: machineExtruderCount.properties.value > 1 ? extrudersModel.getItem(index).name : catalog.i18nc("@label", "Hotend")
color: UM.Theme.getColor("text")
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("default_margin").height
}
Text //Temperature indication.
{
text: printerConnected ? Math.round(connectedPrinter.hotendTemperatures[index]) + "°C" : ""
font: UM.Theme.getFont("large")
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("default_margin").height
id: extruderRectangle
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
Text //Extruder name.
{
text: machineExtruderCount.properties.value > 1 ? extrudersModel.getItem(index).name : catalog.i18nc("@label", "Hotend")
color: UM.Theme.getColor("text")
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("default_margin").height
}
Text //Temperature indication.
{
text: printerConnected ? Math.round(connectedPrinter.hotendTemperatures[index]) + "°C" : ""
font: UM.Theme.getFont("large")
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("default_margin").height
}
}
}
}