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.
This commit is contained in:
Diego Prado Gesto 2019-01-11 14:44:49 +01:00
parent d4621ec504
commit e706020639
4 changed files with 22 additions and 14 deletions

View file

@ -42,8 +42,8 @@ Item
{ {
id: externalLinkIcon id: externalLinkIcon
anchors.verticalCenter: manageQueueLabel.verticalCenter anchors.verticalCenter: manageQueueLabel.verticalCenter
color: UM.Theme.getColor("primary") color: UM.Theme.getColor("text_link")
source: "../svg/icons/external_link.svg" source: UM.Theme.getIcon("external_link")
width: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!) 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?!) height: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!)
} }
@ -56,10 +56,11 @@ Item
leftMargin: 6 * screenScaleFactor // TODO: Theme! leftMargin: 6 * screenScaleFactor // TODO: Theme!
verticalCenter: externalLinkIcon.verticalCenter verticalCenter: externalLinkIcon.verticalCenter
} }
color: UM.Theme.getColor("primary") color: UM.Theme.getColor("text_link")
font: UM.Theme.getFont("default") // 12pt, regular 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") text: catalog.i18nc("@label link to connect manager", "Manage queue in Cura Connect")
renderType: Text.NativeRendering
} }
} }

View file

@ -1,8 +0,0 @@
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="External-site" fill="#2671E7">
<path d="M15.2542746,0 L10.117115,0 C9.70521103,0 9.37138968,0.331077601 9.37138968,0.7395961 C9.37138968,1.1481146 9.70521103,1.4791922 10.117115,1.4791922 L13.5368139,1.4791922 L6.21853299,8.73732261 C5.92715567,9.02612743 5.92715567,9.49450277 6.21853299,9.78330758 C6.36413212,9.92770999 6.55504068,10 6.74577014,10 C6.93649962,10 7.12740818,9.92770999 7.2730073,9.78330758 L14.5085492,2.60705849 L14.5085492,5.83435463 C14.5085492,6.24287313 14.8423706,6.57395074 15.2542746,6.57395074 C15.6661786,6.57395074 16,6.24287313 16,5.83435463 L16,0.7395961 C16,0.331077601 15.6661786,0 15.2542746,0 Z" id="Path"></path>
<path d="M12.2810964,7.69220962 C11.8840075,7.69220962 11.5621929,8.01402427 11.5621929,8.41111317 L11.5621929,14.0829238 C11.5621929,14.3427581 11.3427581,14.5621929 11.0829238,14.5621929 L1.91707615,14.5621929 C1.65724189,14.5621929 1.43780712,14.3427581 1.43780712,14.0829238 L1.43780712,4.91707615 C1.43780712,4.65724189 1.65724189,4.43780712 1.91707615,4.43780712 L7.60891391,4.43780712 C8.00600281,4.43780712 8.32781747,4.11599245 8.32781747,3.71890356 C8.32781747,3.32181465 8.00600281,3 7.60891391,3 L1.91707615,3 C0.859956439,3 0,3.85995644 0,4.91707615 L0,14.0829238 C0,15.1400436 0.859956439,16 1.91707615,16 L11.0829238,16 C12.1400436,16 13,15.1400436 13,14.0829238 L13,8.41111317 C13,8.01419692 12.6781853,7.69220962 12.2810964,7.69220962 Z" id="Path"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -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 Item
{ {
width: parent.width width: parent.width
@ -51,7 +51,11 @@ Item
anchors.left: icon.right anchors.left: icon.right
anchors.right: parent.right anchors.right: parent.right
anchors.leftMargin: UM.Theme.getSize("default_margin").width 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") color: UM.Theme.getColor("text")
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
renderType: Text.NativeRendering renderType: Text.NativeRendering

View file

@ -199,18 +199,29 @@ Cura.ExpandablePopup
text: catalog.i18nc("@label", "See the material compatibility chart") text: catalog.i18nc("@label", "See the material compatibility chart")
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_link") color: UM.Theme.getColor("text_link")
linkColor: UM.Theme.getColor("text_link")
anchors.left: externalLinkIcon.right anchors.left: externalLinkIcon.right
anchors.leftMargin: UM.Theme.getSize("narrow_margin").width anchors.leftMargin: UM.Theme.getSize("narrow_margin").width
renderType: Text.NativeRendering
MouseArea MouseArea
{ {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true
onClicked: onClicked:
{ {
// open the material URL with web browser // open the material URL with web browser
var url = "https://ultimaker.com/incoming-links/cura/material-compatibilty" var url = "https://ultimaker.com/incoming-links/cura/material-compatibilty"
Qt.openUrlExternally(url) Qt.openUrlExternally(url)
} }
onEntered:
{
materialInfoLabel.font.underline = true
}
onExited:
{
materialInfoLabel.font.underline = false
}
} }
} }
} }