Some spacing / anchoring fixes

CL-896
This commit is contained in:
Jaime van Kessel 2018-08-24 13:41:33 +02:00
parent 3e623a6fe6
commit c13f252193
2 changed files with 23 additions and 17 deletions

View file

@ -19,7 +19,7 @@ Component
property var cornerRadius: 4 * screenScaleFactor // TODO: Should be linked to theme. property var cornerRadius: 4 * screenScaleFactor // TODO: Should be linked to theme.
visible: OutputDevice != null visible: OutputDevice != null
anchors.fill: parent anchors.fill: parent
color: UM.Theme.getColor("viewport_background") color: "white"
UM.I18nCatalog UM.I18nCatalog
{ {
@ -29,11 +29,12 @@ Component
Label Label
{ {
id: activePrintersLabel id: printingLabel
font: UM.Theme.getFont("large") font: UM.Theme.getFont("large")
anchors anchors
{ {
margins: UM.Theme.getSize("default_margin").width margins: 2 * UM.Theme.getSize("default_margin").width
leftMargin: 4 * UM.Theme.getSize("default_margin").width
top: parent.top top: parent.top
left: parent.left left: parent.left
right: parent.right right: parent.right
@ -48,10 +49,10 @@ Component
{ {
anchors anchors
{ {
top: activePrintersLabel.bottom top: printingLabel.bottom
left: parent.left left: parent.left
right: parent.right right: parent.right
topMargin: UM.Theme.getSize("default_margin").height topMargin: 2 * UM.Theme.getSize("default_margin").height
bottom: parent.bottom bottom: parent.bottom
bottomMargin: UM.Theme.getSize("default_margin").height bottomMargin: UM.Theme.getSize("default_margin").height
} }
@ -172,7 +173,7 @@ Component
{ {
id: topSpacer id: topSpacer
color: UM.Theme.getColor("viewport_background") color: UM.Theme.getColor("viewport_background")
height: 1 height: 2
anchors anchors
{ {
left: parent.left left: parent.left
@ -214,7 +215,7 @@ Component
{ {
id: jobSpacer id: jobSpacer
color: UM.Theme.getColor("viewport_background") color: UM.Theme.getColor("viewport_background")
height: 1 height: 2
anchors anchors
{ {
left: parent.left left: parent.left
@ -257,7 +258,7 @@ Component
source: modelData.activePrintJob != null ? modelData.activePrintJob.preview_image_url : "" source: modelData.activePrintJob != null ? modelData.activePrintJob.preview_image_url : ""
anchors.top: ownerName.bottom anchors.top: ownerName.bottom
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: parent.width / 3 width: parent.width / 2
height: width height: width
} }
@ -268,7 +269,7 @@ Component
height: width height: width
radius: 0.5 * width radius: 0.5 * width
anchors.left: parent.left anchors.left: parent.left
anchors.top: printJobPreview.bottom anchors.bottom: printJobPreview.bottom
color: UM.Theme.getColor("setting_control_border_highlight") color: UM.Theme.getColor("setting_control_border_highlight")
Image Image
{ {

View file

@ -77,7 +77,7 @@ Item
source: printJob.preview_image_url source: printJob.preview_image_url
anchors.top: ownerName.bottom anchors.top: ownerName.bottom
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: totalTimeLabel.top anchors.bottom: totalTimeLabel.bottom
width: height width: height
} }
@ -186,7 +186,11 @@ Item
{ {
id: sendToTopButton id: sendToTopButton
text: catalog.i18nc("@label", "Move to top") text: catalog.i18nc("@label", "Move to top")
onClicked: OutputDevice.sendJobToTop(printJob.key) onClicked:
{
OutputDevice.sendJobToTop(printJob.key)
popup.close()
}
width: parent.width width: parent.width
enabled: OutputDevice.printJobs[0].key != printJob.key enabled: OutputDevice.printJobs[0].key != printJob.key
anchors.top: parent.top anchors.top: parent.top
@ -203,7 +207,11 @@ Item
{ {
id: deleteButton id: deleteButton
text: catalog.i18nc("@label", "Delete") text: catalog.i18nc("@label", "Delete")
onClicked: OutputDevice.deleteJobFromQueue(printJob.key) onClicked:
{
OutputDevice.deleteJobFromQueue(printJob.key)
popup.close()
}
width: parent.width width: parent.width
anchors.top: sendToTopButton.bottom anchors.top: sendToTopButton.bottom
hoverEnabled: true hoverEnabled: true
@ -312,14 +320,11 @@ Item
Rectangle Rectangle
{ {
color: UM.Theme.getColor("viewport_background") color: UM.Theme.getColor("viewport_background")
width: 1 width: 2
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.margins: UM.Theme.getSize("default_margin").height anchors.margins: UM.Theme.getSize("default_margin").height
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} }
} }
} }