Add printer configuration components

Contributes to CL-1148
This commit is contained in:
Ian Paschal 2018-11-20 13:46:41 +01:00
parent 421a64c7b0
commit fb3cb67da0
8 changed files with 314 additions and 31 deletions

View file

@ -4,12 +4,21 @@
import QtQuick 2.2
import QtQuick.Controls 2.0
import UM 1.3 as UM
import Cura 1.0 as Cura
// A Print Job Card is essentially just a filled-in Expandable Card item.
/**
* A Print Job Card is essentially just a filled-in Expandable Card item. All
* data within it is derived from being passed a printJob property.
*
* NOTE: For most labels, a fixed height with vertical alignment is used to make
* layouts more deterministic (like the fixed-size textboxes used in original
* mock-ups). This is also a stand-in for CSS's 'line-height' property. Denoted
* with '// FIXED-LINE-HEIGHT:'.
*/
Item
{
id: base
// The print job which all other data is derived from
property var printJob: null
width: parent.width
@ -19,15 +28,15 @@ Item
{
headerItem: Row
{
height: 48
height: 48 * screenScaleFactor // TODO: Theme!
anchors.left: parent.left
anchors.leftMargin: 24
spacing: 18
anchors.leftMargin: 24 * screenScaleFactor // TODO: Theme!
spacing: 18 * screenScaleFactor // TODO: Theme!
MonitorPrintJobPreview
{
printJob: base.printJob
size: 32
size: 32 * screenScaleFactor // TODO: Theme!
anchors.verticalCenter: parent.verticalCenter
}
@ -36,10 +45,13 @@ Item
text: printJob && printJob.name ? printJob.name : ""
color: "#374355"
elide: Text.ElideRight
font: UM.Theme.getFont("default_bold")
font: UM.Theme.getFont("medium") // 14pt, regular
anchors.verticalCenter: parent.verticalCenter
width: 216
height: 18
width: 216 * screenScaleFactor // TODO: Theme!
// FIXED-LINE-HEIGHT:
height: 18 * screenScaleFactor // TODO: Theme!
verticalAlignment: Text.AlignVCenter
}
Label
@ -47,18 +59,20 @@ Item
text: printJob ? OutputDevice.formatDuration(printJob.timeTotal) : ""
color: "#374355"
elide: Text.ElideRight
font: UM.Theme.getFont("default_bold")
font: UM.Theme.getFont("medium") // 14pt, regular
anchors.verticalCenter: parent.verticalCenter
width: 216
height: 18
width: 216 * screenScaleFactor // TODO: Theme!
// FIXED-LINE-HEIGHT:
height: 18 * screenScaleFactor // TODO: Theme!
verticalAlignment: Text.AlignVCenter
}
Label
{
color: "#374355"
height: 18
elide: Text.ElideRight
font: UM.Theme.getFont("default_bold")
font: UM.Theme.getFont("medium") // 14pt, regular
text: {
if (printJob !== null) {
if (printJob.assignedPrinter == null)
@ -78,31 +92,39 @@ Item
}
visible: printJob
anchors.verticalCenter: parent.verticalCenter
width: 216
width: 216 * screenScaleFactor // TODO: Theme!
// FIXED-LINE-HEIGHT:
height: 18 * screenScaleFactor // TODO: Theme!
verticalAlignment: Text.AlignVCenter
}
}
drawerItem: Row
{
height: 96
anchors.left: parent.left
anchors.leftMargin: 74
spacing: 18
anchors
{
left: parent.left
leftMargin: 74 * screenScaleFactor // TODO: Theme!
}
height: 96 * screenScaleFactor // TODO: Theme!
spacing: 18 * screenScaleFactor // TODO: Theme!
Rectangle
MonitorPrinterConfiguration
{
id: printerConfiguration
width: 450
height: 72
color: "blue"
anchors.verticalCenter: parent.verticalCenter
printJob: base.printJob
}
Label {
height: 18
text: printJob && printJob.owner ? printJob.owner : ""
color: "#374355"
color: "#374355" // TODO: Theme!
elide: Text.ElideRight
font: UM.Theme.getFont("default_bold")
font: UM.Theme.getFont("medium") // 14pt, regular
anchors.top: printerConfiguration.top
// FIXED-LINE-HEIGHT:
height: 18 * screenScaleFactor // TODO: Theme!
verticalAlignment: Text.AlignVCenter
}
}
}