diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml
index 9888b811e4..0bae22e164 100644
--- a/resources/qml/MonitorButton.qml
+++ b/resources/qml/MonitorButton.qml
@@ -15,6 +15,8 @@ Item
id: base;
UM.I18nCatalog { id: catalog; name:"cura"}
+ height: childrenRect.height + UM.Theme.getSize("sidebar_margin").height
+
property bool printerConnected: Cura.MachineManager.printerConnected
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
property var activePrinter: printerConnected ? Cura.MachineManager.printerOutputDevices[0].activePrinter : null
diff --git a/resources/qml/MonitorSidebar.qml b/resources/qml/MonitorSidebar.qml
index 86e866d895..b761b05380 100644
--- a/resources/qml/MonitorSidebar.qml
+++ b/resources/qml/MonitorSidebar.qml
@@ -24,8 +24,6 @@ Rectangle
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
property var connectedPrinter: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
- property bool monitoringPrint: UM.Controller.activeStage.stageId == "MonitorStage"
-
property variant printDuration: PrintInformation.currentPrintTime
property variant printMaterialLengths: PrintInformation.materialLengths
property variant printMaterialWeights: PrintInformation.materialWeights
@@ -117,202 +115,16 @@ Rectangle
panelWidth: base.width
}
- SidebarHeader {
- id: header
- width: parent.width
- visible: !hideSettings && (machineExtruderCount.properties.value > 1 || Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants) && !monitoringPrint
- anchors.top: machineSelection.bottom
-
- onShowTooltip: base.showTooltip(item, location, text)
- onHideTooltip: base.hideTooltip()
- }
-
- Rectangle {
- id: headerSeparator
- width: parent.width
- visible: settingsModeSelection.visible && header.visible
- height: visible ? UM.Theme.getSize("sidebar_lining").height : 0
- color: UM.Theme.getColor("sidebar_lining")
- anchors.top: header.bottom
- anchors.topMargin: visible ? UM.Theme.getSize("sidebar_margin").height : 0
- }
-
- onCurrentModeIndexChanged:
- {
- UM.Preferences.setValue("cura/active_mode", currentModeIndex);
- if(modesListModel.count > base.currentModeIndex)
- {
- sidebarContents.replace(modesListModel.get(base.currentModeIndex).item, { "replace": true })
- }
- }
-
- Label
- {
- id: settingsModeLabel
- text: !hideSettings ? catalog.i18nc("@label:listbox", "Print Setup") : catalog.i18nc("@label:listbox", "Print Setup disabled\nG-code files cannot be modified")
- renderType: Text.NativeRendering
- anchors.left: parent.left
- anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width
- anchors.top: hideSettings ? machineSelection.bottom : headerSeparator.bottom
- anchors.topMargin: UM.Theme.getSize("sidebar_margin").height
- width: Math.round(parent.width * 0.45)
- font: UM.Theme.getFont("large")
- color: UM.Theme.getColor("text")
- visible: !monitoringPrint && !hideView
- }
-
- // Settings mode selection toggle
- Rectangle
- {
- id: settingsModeSelection
- color: "transparent"
-
- width: Math.round(parent.width * 0.55)
- height: UM.Theme.getSize("sidebar_header_mode_toggle").height
-
- anchors.right: parent.right
- anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width
- anchors.topMargin: UM.Theme.getSize("sidebar_margin").height
- anchors.top:
- {
- if (settingsModeLabel.contentWidth >= parent.width - width - UM.Theme.getSize("sidebar_margin").width * 2)
- {
- return settingsModeLabel.bottom;
- }
- else
- {
- return headerSeparator.bottom;
- }
- }
-
- visible: !monitoringPrint && !hideSettings && !hideView
-
- Component
- {
- id: wizardDelegate
-
- Button
- {
- id: control
-
- height: settingsModeSelection.height
- width: Math.round(parent.width / 2)
-
- anchors.left: parent.left
- anchors.leftMargin: model.index * Math.round(settingsModeSelection.width / 2)
- anchors.verticalCenter: parent.verticalCenter
-
- ButtonGroup.group: modeMenuGroup
-
- checkable: true
- checked: base.currentModeIndex == index
- onClicked: base.currentModeIndex = index
-
- onHoveredChanged:
- {
- if (hovered)
- {
- tooltipDelayTimer.item = settingsModeSelection
- tooltipDelayTimer.text = model.tooltipText
- tooltipDelayTimer.start()
- }
- else
- {
- tooltipDelayTimer.stop()
- base.hideTooltip()
- }
- }
-
- background: Rectangle
- {
- border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width
- border.color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_border") : control.hovered ? UM.Theme.getColor("action_button_hovered_border"): UM.Theme.getColor("action_button_border")
-
- // for some reason, QtQuick decided to use the color of the background property as text color for the contentItem, so here it is
- color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") : control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
- }
-
- contentItem: Label
- {
- text: model.text
- font: UM.Theme.getFont("default")
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- renderType: Text.NativeRendering
- elide: Text.ElideRight
- color:
- {
- if(control.pressed)
- {
- return UM.Theme.getColor("action_button_active_text");
- }
- else if(control.hovered)
- {
- return UM.Theme.getColor("action_button_hovered_text");
- }
- return UM.Theme.getColor("action_button_text");
- }
- }
- }
- }
-
- ButtonGroup
- {
- id: modeMenuGroup
- }
-
- ListView
- {
- id: modesList
- property var index: 0
- model: modesListModel
- delegate: wizardDelegate
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- }
- }
-
- StackView
- {
- id: sidebarContents
-
- anchors.bottom: footerSeparator.top
- anchors.top: settingsModeSelection.bottom
- anchors.topMargin: UM.Theme.getSize("sidebar_margin").height
- anchors.left: base.left
- anchors.right: base.right
- visible: !monitoringPrint && !hideSettings
-
- replaceEnter: Transition {
- PropertyAnimation {
- property: "opacity"
- from: 0
- to:1
- duration: 100
- }
- }
-
- replaceExit: Transition {
- PropertyAnimation {
- property: "opacity"
- from: 1
- to:0
- duration: 100
- }
- }
- }
-
Loader
{
id: controlItem
anchors.bottom: footerSeparator.top
- anchors.top: monitoringPrint ? machineSelection.bottom : headerSeparator.bottom
+ anchors.top: machineSelection.bottom
anchors.left: base.left
anchors.right: base.right
sourceComponent:
{
- if(monitoringPrint && connectedPrinter != null)
+ if(connectedPrinter != null)
{
if(connectedPrinter.controlItem != null)
{
@@ -326,20 +138,14 @@ Rectangle
Loader
{
anchors.bottom: footerSeparator.top
- anchors.top: monitoringPrint ? machineSelection.bottom : headerSeparator.bottom
+ anchors.top: machineSelection.bottom
anchors.left: base.left
anchors.right: base.right
source:
{
if(controlItem.sourceComponent == null)
{
- if(monitoringPrint)
- {
- return "PrintMonitor.qml"
- } else
- {
- return "SidebarContents.qml"
- }
+ return "PrintMonitor.qml"
}
else
{
@@ -354,242 +160,16 @@ Rectangle
width: parent.width
height: UM.Theme.getSize("sidebar_lining").height
color: UM.Theme.getColor("sidebar_lining")
- anchors.bottom: printSpecs.top
- anchors.bottomMargin: Math.round(UM.Theme.getSize("sidebar_margin").height * 2 + UM.Theme.getSize("progressbar").height + UM.Theme.getFont("default_bold").pixelSize)
- }
-
- Item
- {
- id: printSpecs
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width
+ anchors.bottom: monitorButton.top
anchors.bottomMargin: UM.Theme.getSize("sidebar_margin").height
- height: timeDetails.height + costSpec.height
- width: base.width - (saveButton.buttonRowWidth + UM.Theme.getSize("sidebar_margin").width)
- visible: !monitoringPrint
- clip: true
-
- Label
- {
- id: timeDetails
- anchors.left: parent.left
- anchors.bottom: costSpec.top
- font: UM.Theme.getFont("large")
- color: UM.Theme.getColor("text_subtext")
- text: (!base.printDuration || !base.printDuration.valid) ? catalog.i18nc("@label Hours and minutes", "00h 00min") : base.printDuration.getDisplayString(UM.DurationFormat.Short)
- renderType: Text.NativeRendering
-
- MouseArea
- {
- id: timeDetailsMouseArea
- anchors.fill: parent
- hoverEnabled: true
-
- onEntered:
- {
- if(base.printDuration.valid && !base.printDuration.isTotalDurationZero)
- {
- // All the time information for the different features is achieved
- var print_time = PrintInformation.getFeaturePrintTimes();
- var total_seconds = parseInt(base.printDuration.getDisplayString(UM.DurationFormat.Seconds))
-
- // A message is created and displayed when the user hover the time label
- var tooltip_html = "%1
" + feature + ": | " + - "%1 | ".arg(print_time[feature].getDisplayString(UM.DurationFormat.ISO8601).slice(0,-3)) + - "%1% | ".arg(Math.round(100 * parseInt(print_time[feature].getDisplayString(UM.DurationFormat.Seconds)) / total_seconds)) + - "