From 62b586a6ff17ac88de36a89480a74c337e631e9c Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Thu, 19 Apr 2018 10:21:19 +0200 Subject: [PATCH] CURA-5250 Add hint when the buildplate is just usable but not the recommended. --- resources/qml/SidebarHeader.qml | 40 +++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 7590beddc4..978148d2a6 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -18,6 +18,8 @@ Column property bool currentExtruderVisible: extrudersList.visible; property bool printerConnected: Cura.MachineManager.printerConnected property bool hasManyPrinterTypes: printerConnected ? Cura.MachineManager.printerOutputDevices[0].connectedPrintersTypeCount.length > 1 : 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) @@ -382,14 +384,16 @@ Column anchors.right: parent.right style: UM.Theme.styles.sidebar_header_button activeFocusOnPress: true; - menu: MaterialMenu { + menu: MaterialMenu + { extruderIndex: base.currentExtruderIndex } property var valueError: !isMaterialSupported() property var valueWarning: ! Cura.MachineManager.isActiveQualitySupported - function isMaterialSupported () { + function isMaterialSupported () + { if (!hasActiveExtruder) { return false; @@ -425,7 +429,8 @@ Column color: UM.Theme.getColor("text"); } - ToolButton { + ToolButton + { id: variantSelection text: Cura.MachineManager.activeVariantName tooltip: Cura.MachineManager.activeVariantName; @@ -441,7 +446,8 @@ Column } } - Rectangle { + Rectangle + { id: buildplateSeparator anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width @@ -477,7 +483,8 @@ Column color: UM.Theme.getColor("text"); } - ToolButton { + ToolButton + { id: buildplateSelection text: Cura.MachineManager.activeVariantBuildplateName tooltip: Cura.MachineManager.activeVariantBuildplateName @@ -501,7 +508,7 @@ Column { id: materialInfoRow height: Math.round(UM.Theme.getSize("sidebar_setup").height / 2) - visible: (Cura.MachineManager.hasVariants || Cura.MachineManager.hasMaterials) && !sidebar.monitoringPrint && !sidebar.hideSettings + visible: (Cura.MachineManager.hasVariants || Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariantBuildplates) && !sidebar.monitoringPrint && !sidebar.hideSettings anchors { @@ -511,10 +518,25 @@ Column rightMargin: UM.Theme.getSize("sidebar_margin").width } - Item { + Label + { + id: materialCompatibilityLabel + y: -Math.round(UM.Theme.getSize("sidebar_margin").height / 3) + anchors.left: parent.left + width: parent.width - materialCompatibilityLink.width + text: catalog.i18nc("@label", "Use adhesion sheet or glue with this material combination") + font: UM.Theme.getFont("very_small") + visible: buildplateCompatibilityError || buildplateCompatibilityWarning + wrapMode: Text.WordWrap + opacity: 0.5 + } + + Item + { + id: materialCompatibilityLink height: UM.Theme.getSize("sidebar_setup").height anchors.right: parent.right - width: Math.round(parent.width * 0.7 + UM.Theme.getSize("sidebar_margin").width) + width: childrenRect.width + UM.Theme.getSize("default_margin").width UM.RecolorImage { id: warningImage @@ -527,7 +549,7 @@ Column sourceSize.width: width sourceSize.height: height color: UM.Theme.getColor("material_compatibility_warning") - visible: !Cura.MachineManager.isCurrentSetupSupported + visible: !Cura.MachineManager.isCurrentSetupSupported || buildplateCompatibilityError || buildplateCompatibilityWarning } Label {