From c14aa3686cfb2f747d30939439ac2d94c9d02109 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Tue, 19 Feb 2019 12:23:03 +0100 Subject: [PATCH 1/5] Add some new colors to theme Contributes to CL-1247 --- resources/themes/cura-dark/theme.json | 1 + resources/themes/cura-light/theme.json | 1 + 2 files changed, 2 insertions(+) diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 41033e7e75..aed45e8a71 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -222,6 +222,7 @@ "monitor_text_link": [103, 160, 252, 255], "monitor_icon_primary": [229, 229, 229, 255], "monitor_icon_accent": [51, 53, 54, 255], + "monitor_icon_disabled": [102, 102, 102, 255], "monitor_secondary_button_hover": [80, 80, 80, 255], "monitor_secondary_button": [92, 92, 92, 255], diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 92308537dd..a0a21c31f3 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -397,6 +397,7 @@ "monitor_text_link": [50, 130, 255, 255], "monitor_icon_primary": [10, 8, 80, 255], "monitor_icon_accent": [255, 255, 255, 255], + "monitor_icon_disabled": [238, 238, 238, 255], "monitor_secondary_button_hover": [228, 228, 228, 255], "monitor_secondary_button": [240, 240, 240, 255], From e23dd2dd6b30313bc9db3abefb5d95da3aa7ed1e Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Tue, 19 Feb 2019 12:23:33 +0100 Subject: [PATCH 2/5] Grey-out buttons when using cloud connection Contributes to CL-1247 (includes some boyscoutin') --- .../resources/qml/CameraButton.qml | 43 +++++++++++-------- .../qml/MonitorContextMenuButton.qml | 4 +- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/CameraButton.qml b/plugins/UM3NetworkPrinting/resources/qml/CameraButton.qml index bf7690ac37..c0369cac0b 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/CameraButton.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/CameraButton.qml @@ -7,34 +7,39 @@ import QtQuick.Controls.Styles 1.3 import UM 1.3 as UM import Cura 1.0 as Cura -Rectangle { +Rectangle +{ id: base property var enabled: true - property var iconSource: null; - color: UM.Theme.getColor("monitor_icon_primary") - height: width; - radius: Math.round(0.5 * width); - width: 24 * screenScaleFactor; + property var iconSource: null + color: enabled ? UM.Theme.getColor("monitor_icon_primary") : UM.Theme.getColor("monitor_icon_disabled") + height: width + radius: Math.round(0.5 * width) + width: 24 * screenScaleFactor - UM.RecolorImage { - id: icon; - anchors { - horizontalCenter: parent.horizontalCenter; - verticalCenter: parent.verticalCenter; + UM.RecolorImage + { + id: icon + anchors + { + horizontalCenter: parent.horizontalCenter + verticalCenter: parent.verticalCenter } - color: UM.Theme.getColor("monitor_icon_accent"); - height: width; - source: iconSource; - width: Math.round(parent.width / 2); + color: UM.Theme.getColor("monitor_icon_accent") + height: width + source: iconSource + width: Math.round(parent.width / 2) } - MouseArea { - id: clickArea; - anchors.fill: parent; + MouseArea + { + id: clickArea + anchors.fill: parent hoverEnabled: base.enabled - onClicked: { + onClicked: + { if (base.enabled) { if (OutputDevice.activeCameraUrl != "") diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenuButton.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenuButton.qml index 3e4f1839b6..ba85802809 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenuButton.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenuButton.qml @@ -11,14 +11,14 @@ Button id: base background: Rectangle { - color: UM.Theme.getColor("viewport_background") // TODO: Theme! + color: enabled ? UM.Theme.getColor("viewport_background") : "transparent" height: base.height opacity: base.down || base.hovered ? 1 : 0 radius: Math.round(0.5 * width) width: base.width } contentItem: Label { - color: UM.Theme.getColor("monitor_text_primary") + color: enabled ? UM.Theme.getColor("monitor_text_primary") : UM.Theme.getColor("monitor_text_disabled") font.pixelSize: 32 * screenScaleFactor horizontalAlignment: Text.AlignHCenter text: base.text From b6b7f8cfce8deae3d6a0ce85ca8cb17186093983 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Tue, 19 Feb 2019 12:23:48 +0100 Subject: [PATCH 3/5] Disable queue link when connected to cloud Contributes to CL-1247 --- .../UM3NetworkPrinting/resources/qml/MonitorQueue.qml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml index c75bd4190f..2a95e57838 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml @@ -14,6 +14,10 @@ import Cura 1.0 as Cura */ Item { + // If the printer is a cloud printer or not. Other items base their enabled state off of this boolean. In the future + // they might not need to though. + property bool cloudConnection: Cura.MachineManager.activeMachineIsUsingCloudConnection + Label { id: queuedLabel @@ -42,7 +46,7 @@ Item { id: externalLinkIcon anchors.verticalCenter: manageQueueLabel.verticalCenter - color: UM.Theme.getColor("monitor_text_link") + color: !cloudConnection ? UM.Theme.getColor("monitor_text_link") : UM.Theme.getColor("monitor_text_disabled") source: UM.Theme.getIcon("external_link") width: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!) height: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!) @@ -67,7 +71,8 @@ Item MouseArea { anchors.fill: manageQueueLabel - hoverEnabled: true + enabled: !cloudConnection + hoverEnabled: enabled onClicked: Cura.MachineManager.printerOutputDevices[0].openPrintJobControlPanel() onEntered: { From 0ef014a542fe29e74cfe1eed30235f88abf9fabb Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Tue, 19 Feb 2019 12:24:04 +0100 Subject: [PATCH 4/5] Don't show "Review Connection" unless you're on the LAN Contributes to CL-1247 --- plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py b/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py index e57cd15960..4a08b39c8b 100644 --- a/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py +++ b/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py @@ -481,8 +481,10 @@ class UM3OutputDevicePlugin(OutputDevicePlugin): "cloud-flow-completed.svg"), image_caption = i18n_catalog.i18nc("@info:status", "Connected!") ) - self._cloud_flow_complete_message.addAction("", i18n_catalog.i18nc("@action", "Review your connection"), "", "", 1) # TODO: Icon - self._cloud_flow_complete_message.actionTriggered.connect(self._onReviewCloudConnection) + # Don't show the review connection link if we're not on the local network + if self._application.getMachineManager().activeMachineHasNetworkConnection: + self._cloud_flow_complete_message.addAction("", i18n_catalog.i18nc("@action", "Review your connection"), "", "", 1) # TODO: Icon + self._cloud_flow_complete_message.actionTriggered.connect(self._onReviewCloudConnection) self._cloud_flow_complete_message.show() # Set the machine's cloud flow as complete so we don't ask the user again and again for cloud connected printers From 7b3420653e4cb831c95e0786e935ffc645b18928 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Tue, 19 Feb 2019 12:27:41 +0100 Subject: [PATCH 5/5] Actually, just hide manage queue on cloud Contributes to CL-1247 --- plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml index 2a95e57838..5d824ada97 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml @@ -41,12 +41,13 @@ Item } height: 18 * screenScaleFactor // TODO: Theme! width: childrenRect.width + visible: !cloudConnection UM.RecolorImage { id: externalLinkIcon anchors.verticalCenter: manageQueueLabel.verticalCenter - color: !cloudConnection ? UM.Theme.getColor("monitor_text_link") : UM.Theme.getColor("monitor_text_disabled") + color: UM.Theme.getColor("monitor_text_link") source: UM.Theme.getIcon("external_link") width: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!) height: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!) @@ -72,7 +73,7 @@ Item { anchors.fill: manageQueueLabel enabled: !cloudConnection - hoverEnabled: enabled + hoverEnabled: !cloudConnection onClicked: Cura.MachineManager.printerOutputDevices[0].openPrintJobControlPanel() onEntered: {