Merge pull request #6335 from Ultimaker/CS-158_fix_monitor_progress_bar

CS-158 Fix monitor tab print status (4.3 cherry pick)
This commit is contained in:
Simon Edwards 2019-09-11 15:05:13 +02:00 committed by GitHub
commit 4ab84c0568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 9 deletions

View File

@ -20,7 +20,7 @@ Item
property var printJob: null property var printJob: null
width: childrenRect.width width: childrenRect.width
height: 18 * screenScaleFactor // TODO: Theme! height: UM.Theme.getSize("monitor_text_line").height
UM.ProgressBar UM.ProgressBar
{ {
@ -31,7 +31,7 @@ Item
left: parent.left left: parent.left
} }
value: printJob ? printJob.progress : 0 value: printJob ? printJob.progress : 0
width: UM.Theme.getSize("monitor_column").width width: UM.Theme.getSize("monitor_progress_bar").width
} }
Label Label
@ -40,16 +40,16 @@ Item
anchors anchors
{ {
left: progressBar.right left: progressBar.right
leftMargin: 18 * screenScaleFactor // TODO: Theme! leftMargin: UM.Theme.getSize("monitor_margin").width
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
text: printJob ? Math.round(printJob.progress * 100) + "%" : "0%" text: printJob ? Math.round(printJob.progress * 100) + "%" : "0%"
color: printJob && printJob.isActive ? UM.Theme.getColor("monitor_text_primary") : UM.Theme.getColor("monitor_text_disabled") color: printJob && printJob.isActive ? UM.Theme.getColor("monitor_text_primary") : UM.Theme.getColor("monitor_text_disabled")
width: contentWidth width: contentWidth
font: UM.Theme.getFont("medium") // 14pt, regular font: UM.Theme.getFont("default") // 12pt, regular
// FIXED-LINE-HEIGHT: // FIXED-LINE-HEIGHT:
height: 18 * screenScaleFactor // TODO: Theme! height: UM.Theme.getSize("monitor_text_line").height
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
@ -59,11 +59,11 @@ Item
anchors anchors
{ {
left: percentLabel.right left: percentLabel.right
leftMargin: 18 * screenScaleFactor // TODO: Theme! leftMargin: UM.Theme.getSize("monitor_margin").width
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
color: UM.Theme.getColor("monitor_text_primary") color: UM.Theme.getColor("monitor_text_primary")
font: UM.Theme.getFont("medium") // 14pt, regular font: UM.Theme.getFont("default") // 12pt, regular
text: text:
{ {
if (!printJob) if (!printJob)
@ -103,7 +103,7 @@ Item
width: contentWidth width: contentWidth
// FIXED-LINE-HEIGHT: // FIXED-LINE-HEIGHT:
height: 18 * screenScaleFactor // TODO: Theme! height: UM.Theme.getSize("monitor_text_line").height
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }

View File

@ -619,6 +619,8 @@
"monitor_empty_state_offset": [5.6, 5.6], "monitor_empty_state_offset": [5.6, 5.6],
"monitor_empty_state_size": [35.0, 25.0], "monitor_empty_state_size": [35.0, 25.0],
"monitor_external_link_icon": [1.16, 1.16], "monitor_external_link_icon": [1.16, 1.16],
"monitor_column": [18.0, 1.0] "monitor_column": [18.0, 1.0],
"monitor_progress_bar": [16.5, 1.0],
"monitor_margin": [1.5, 1.5]
} }
} }