From e7060206396f7cc4a30e82e3d4b8c7036e152d4b Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Fri, 11 Jan 2019 14:44:49 +0100 Subject: [PATCH] Improve the text when there is no configuration available It can happen that the list is empty because the data is still coming or because the connection has been lost. There are also some improvements in the link to the compatibility chart. Now the two external links in Cura have the same behaviour. Contributes to CURA-6011. --- .../UM3NetworkPrinting/resources/qml/MonitorQueue.qml | 9 +++++---- .../resources/svg/icons/external_link.svg | 8 -------- .../Menus/ConfigurationMenu/ConfigurationListView.qml | 8 ++++++-- .../qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 11 +++++++++++ 4 files changed, 22 insertions(+), 14 deletions(-) delete mode 100644 plugins/UM3NetworkPrinting/resources/svg/icons/external_link.svg diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml index 124b268300..f2dc09de95 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml @@ -42,8 +42,8 @@ Item { id: externalLinkIcon anchors.verticalCenter: manageQueueLabel.verticalCenter - color: UM.Theme.getColor("primary") - source: "../svg/icons/external_link.svg" + color: UM.Theme.getColor("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?!) } @@ -56,10 +56,11 @@ Item leftMargin: 6 * screenScaleFactor // TODO: Theme! verticalCenter: externalLinkIcon.verticalCenter } - color: UM.Theme.getColor("primary") + color: UM.Theme.getColor("text_link") font: UM.Theme.getFont("default") // 12pt, regular - linkColor: UM.Theme.getColor("primary") + linkColor: UM.Theme.getColor("text_link") text: catalog.i18nc("@label link to connect manager", "Manage queue in Cura Connect") + renderType: Text.NativeRendering } } diff --git a/plugins/UM3NetworkPrinting/resources/svg/icons/external_link.svg b/plugins/UM3NetworkPrinting/resources/svg/icons/external_link.svg deleted file mode 100644 index a2130fb97b..0000000000 --- a/plugins/UM3NetworkPrinting/resources/svg/icons/external_link.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index e57b21cb78..15d882fdf5 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -23,7 +23,7 @@ Item } } - // This component will appear when there is no configurations (e.g. when losing connection) + // This component will appear when there are no configurations (e.g. when losing connection or when they are being loaded) Item { width: parent.width @@ -51,7 +51,11 @@ Item anchors.left: icon.right anchors.right: parent.right anchors.leftMargin: UM.Theme.getSize("default_margin").width - text: catalog.i18nc("@label", "Downloading the configurations from the remote printer") + // There are two cases that we want to diferenciate, one is when Cura is loading the configurations and the + // other when the connection was lost + text: Cura.MachineManager.printerConnected ? + catalog.i18nc("@label", "Loading available configurations from the printer...") : + catalog.i18nc("@label", "The configurations are not available because the printer is disconnected.") color: UM.Theme.getColor("text") font: UM.Theme.getFont("default") renderType: Text.NativeRendering diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 491a2f069f..7d09f4be38 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -199,18 +199,29 @@ Cura.ExpandablePopup text: catalog.i18nc("@label", "See the material compatibility chart") font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_link") + linkColor: UM.Theme.getColor("text_link") anchors.left: externalLinkIcon.right anchors.leftMargin: UM.Theme.getSize("narrow_margin").width + renderType: Text.NativeRendering MouseArea { anchors.fill: parent + hoverEnabled: true onClicked: { // open the material URL with web browser var url = "https://ultimaker.com/incoming-links/cura/material-compatibilty" Qt.openUrlExternally(url) } + onEntered: + { + materialInfoLabel.font.underline = true + } + onExited: + { + materialInfoLabel.font.underline = false + } } } }