diff --git a/plugins/BlackBeltPlugin/BlackBeltPlugin.py b/plugins/BlackBeltPlugin/BlackBeltPlugin.py index 83b396aafa..99b0306a64 100644 --- a/plugins/BlackBeltPlugin/BlackBeltPlugin.py +++ b/plugins/BlackBeltPlugin/BlackBeltPlugin.py @@ -77,7 +77,7 @@ class BlackBeltPlugin(Extension): self._application._engine.rootObjects()[0].setTitle(i18n_catalog.i18nc("@title:window","BlackBelt Cura")) # Substitute our own sidebar - sidebar_component_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "sidebar", "Sidebar.qml") + sidebar_component_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "sidebar", "PrepareSidebar.qml") prepare_stage = Application.getInstance().getController().getStage("PrepareStage") prepare_stage.addDisplayComponent("sidebar", sidebar_component_path) diff --git a/plugins/BlackBeltPlugin/sidebar/Sidebar.qml b/plugins/BlackBeltPlugin/sidebar/PrepareSidebar.qml similarity index 94% rename from plugins/BlackBeltPlugin/sidebar/Sidebar.qml rename to plugins/BlackBeltPlugin/sidebar/PrepareSidebar.qml index e48d0a5d1b..343cfcbe2e 100644 --- a/plugins/BlackBeltPlugin/sidebar/Sidebar.qml +++ b/plugins/BlackBeltPlugin/sidebar/PrepareSidebar.qml @@ -18,12 +18,10 @@ Rectangle // Is there an output device for this printer? property bool isNetworkPrinter: Cura.MachineManager.activeMachineNetworkKey != "" - property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0 + property bool printerConnected: Cura.MachineManager.printerConnected 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 @@ -118,7 +116,7 @@ Rectangle SidebarHeader { id: header width: parent.width - visible: !hideSettings && (machineExtruderCount.properties.value > 1 || Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants) && !monitoringPrint + visible: !hideSettings && (machineExtruderCount.properties.value > 1 || Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants) anchors.top: machineSelection.bottom onShowTooltip: base.showTooltip(item, location, text) @@ -156,7 +154,7 @@ Rectangle width: Math.round(parent.width * 0.45) font: UM.Theme.getFont("large") color: UM.Theme.getColor("text") - visible: !monitoringPrint && !hideView + visible: !hideView } // Settings mode selection toggle @@ -183,7 +181,7 @@ Rectangle } } - visible: !monitoringPrint && !hideSettings && !hideView + visible: !hideSettings && !hideView Component { @@ -280,7 +278,7 @@ Rectangle anchors.topMargin: UM.Theme.getSize("sidebar_margin").height anchors.left: base.left anchors.right: base.right - visible: !monitoringPrint && !hideSettings + visible: !hideSettings replaceEnter: Transition { PropertyAnimation { @@ -303,25 +301,13 @@ Rectangle Loader { - id: controlItem anchors.bottom: footerSeparator.top - anchors.top: monitoringPrint ? machineSelection.bottom : headerSeparator.bottom + anchors.top: headerSeparator.bottom anchors.left: base.left anchors.right: base.right - sourceComponent: - { - if(monitoringPrint && connectedPrinter != null) - { - if(connectedPrinter.controlItem != null) - { - return connectedPrinter.controlItem - } - } - return null - } + source: "SidebarContents.qml" } - Rectangle { id: footerSeparator @@ -341,7 +327,6 @@ Rectangle 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 @@ -544,8 +529,7 @@ Rectangle } } - // SaveButton and MonitorButton are actually the bottom footer panels. - // "!monitoringPrint" currently means "show-settings-mode" + // SaveButton is actually the bottom footer panel. Cura.SaveButton { id: saveButton @@ -553,17 +537,6 @@ Rectangle anchors.top: footerSeparator.bottom anchors.topMargin: UM.Theme.getSize("sidebar_margin").height anchors.bottom: parent.bottom - visible: !monitoringPrint - } - - Cura.MonitorButton - { - id: monitorButton - implicitWidth: base.width - anchors.top: footerSeparator.bottom - anchors.topMargin: UM.Theme.getSize("sidebar_margin").height - anchors.bottom: parent.bottom - visible: monitoringPrint } Cura.SidebarTooltip diff --git a/plugins/BlackBeltPlugin/sidebar/SidebarHeader.qml b/plugins/BlackBeltPlugin/sidebar/SidebarHeader.qml index 6abb1f7ed6..1dce3a660a 100644 --- a/plugins/BlackBeltPlugin/sidebar/SidebarHeader.qml +++ b/plugins/BlackBeltPlugin/sidebar/SidebarHeader.qml @@ -14,8 +14,20 @@ Column property int currentExtruderIndex: Cura.ExtruderManager.activeExtruderIndex; property bool currentExtruderVisible: extrudersList.visible; - property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0 - property bool hasManyPrinterTypes: printerConnected ? Cura.MachineManager.printerOutputDevices[0].connectedPrintersTypeCount.length > 1 : false + property bool printerConnected: Cura.MachineManager.printerConnected + property bool hasManyPrinterTypes: + { + if (printerConnected) + { + if (Cura.MachineManager.printerOutputDevices[0].connectedPrintersTypeCount != null) + { + return Cura.MachineManager.printerOutputDevices[0].connectedPrintersTypeCount.length > 1; + } + } + return false; + } + property bool buildplateCompatibilityError: !Cura.MachineManager.variantBuildplateCompatible && !Cura.MachineManager.variantBuildplateUsable + property bool buildplateCompatibilityWarning: Cura.MachineManager.variantBuildplateUsable spacing: Math.round(UM.Theme.getSize("sidebar_margin").width * 0.9) diff --git a/plugins/BlackBeltPlugin/sidebar/SidebarSimple.qml b/plugins/BlackBeltPlugin/sidebar/SidebarSimple.qml index 048772d792..82033f7f5d 100644 --- a/plugins/BlackBeltPlugin/sidebar/SidebarSimple.qml +++ b/plugins/BlackBeltPlugin/sidebar/SidebarSimple.qml @@ -247,17 +247,19 @@ Item { function showTooltip (showTooltip) { - if (showTooltip) { + if (showTooltip) + { var content = catalog.i18nc("@tooltip", "This quality profile is not available for you current material and nozzle configuration. Please change these to enable this quality profile") base.showTooltip(qualityRow, Qt.point(-UM.Theme.getSize("sidebar_margin").width, customisedSettings.height), content) } - else { + else + { base.hideTooltip() } } id: unavailableLineToolTip - height: 20 // hovered area height + height: 20 * screenScaleFactor // hovered area height z: parent.z + 1 // should be higher, otherwise the area can be hovered x: 0 anchors.verticalCenter: qualitySlider.verticalCenter @@ -267,7 +269,8 @@ Item id: leftArea width: { - if (qualityModel.availableTotalTicks == 0) { + if (qualityModel.availableTotalTicks == 0) + { return qualityModel.qualitySliderStepWidth * qualityModel.totalTicks } return qualityModel.qualitySliderStepWidth * qualityModel.qualitySliderAvailableMin - 10