From c8bdf7321c4a888025001064f11c852097404264 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Fri, 26 Oct 2018 16:31:03 +0200 Subject: [PATCH] Move the visible check within the component. Contributes to CURA-5772. --- plugins/PrepareStage/PrepareMenu.qml | 4 ---- .../Menus/ConfigurationMenu/QuickConfigurationSelector.qml | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/PrepareStage/PrepareMenu.qml b/plugins/PrepareStage/PrepareMenu.qml index 27d068e909..c7f8a3b0f1 100644 --- a/plugins/PrepareStage/PrepareMenu.qml +++ b/plugins/PrepareStage/PrepareMenu.qml @@ -13,9 +13,6 @@ Item signal showTooltip(Item item, point location, string text) signal hideTooltip() - property bool isNetworkPrinter: Cura.MachineManager.activeMachineNetworkKey != "" - property bool printerConnected: Cura.MachineManager.printerConnected - UM.I18nCatalog { id: catalog @@ -53,7 +50,6 @@ Item Cura.QuickConfigurationSelector { id: configSelection - visible: isNetworkPrinter && printerConnected width: visible ? Math.round(UM.Theme.getSize("sidebar").width * 0.15) : 0 panelWidth: Math.round(0.8 * UM.Theme.getSize("sidebar").width) height: prepareMenu.height diff --git a/resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml b/resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml index d7ee2c68ee..740c12d340 100644 --- a/resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml +++ b/resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml @@ -14,6 +14,9 @@ Item property var connectedDevice: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null property var panelWidth: control.width + // Make this component only visible when it's a network printer and it is connected + visible: Cura.MachineManager.activeMachineNetworkKey != "" && Cura.MachineManager.printerConnected + function switchPopupState() { popup.visible ? popup.close() : popup.open()