Add printer pill type to cluster monitor printer tile

CL-896
This commit is contained in:
Jaime van Kessel 2018-08-31 16:47:26 +02:00
parent 8aef7216ec
commit 98d0ad6c27
2 changed files with 40 additions and 2 deletions

View file

@ -233,11 +233,21 @@ Component
topMargin: UM.Theme.getSize("default_margin").width topMargin: UM.Theme.getSize("default_margin").width
} }
} }
PrinterFamilyPill
{
id: printerFamilyPill
color: UM.Theme.getColor("viewport_background")
anchors.top: topSpacer.bottom
anchors.topMargin: 2 * UM.Theme.getSize("default_margin").height
text: modelData.type
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
padding: 3
}
Row Row
{ {
id: extrudersInfo id: extrudersInfo
anchors.top: topSpacer.bottom anchors.top: printerFamilyPill.bottom
anchors.topMargin: 2 * UM.Theme.getSize("default_margin").height anchors.topMargin: 2 * UM.Theme.getSize("default_margin").height
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 2 * UM.Theme.getSize("default_margin").width anchors.leftMargin: 2 * UM.Theme.getSize("default_margin").width

View file

@ -0,0 +1,28 @@
import QtQuick 2.2
import QtQuick.Controls 1.4
import UM 1.2 as UM
Item
{
property alias color: background.color
property alias text: familyNameLabel.text
property var padding: 0
implicitHeight: familyNameLabel.contentHeight + 2 * padding // Apply the padding to top and bottom.
implicitWidth: familyNameLabel.contentWidth + implicitHeight // The extra height is added to ensure the radius doesn't cut something off.
Rectangle
{
id: background
height: parent.height
width: parent.width
color: parent.color
anchors.right: parent.right
anchors.horizontalCenter: parent.horizontalCenter
radius: 0.5 * height
}
Label
{
id: familyNameLabel
anchors.centerIn: parent
text: ""
}
}