From 65dd0250b3f2c52a0e733af15e7bbfd85318322b Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Thu, 4 Jun 2020 14:22:14 +0200 Subject: [PATCH] Change property connectionStatusMessage into a get function This way the tooltip text can be re-evaluated every time we hover over the instead of only once when the active machine is updated. With this change, the text will be updated properly when there is a change. CURA-7438 --- resources/qml/PrinterSelector/MachineSelector.qml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml index 56a3d858ec..b3293c00cd 100644 --- a/resources/qml/PrinterSelector/MachineSelector.qml +++ b/resources/qml/PrinterSelector/MachineSelector.qml @@ -35,7 +35,7 @@ Cura.ExpandablePopup } } - readonly property string connectionStatusMessage: { + function getConnectionStatusMessage() { if (connectionStatus == "printer_cloud_not_available") { if(Cura.API.connectionStatus.isInternetReachable) @@ -139,12 +139,13 @@ Cura.ExpandablePopup { id: connectionStatusTooltipHoverArea anchors.fill: parent - hoverEnabled: connectionStatusMessage !== "" + hoverEnabled: getConnectionStatusMessage() !== "" acceptedButtons: Qt.NoButton // react to hover only, don't steal clicks onEntered: { machineSelector.mouseArea.entered() // we want both this and the outer area to be entered + tooltip.tooltipText = getConnectionStatusMessage() tooltip.show() } onExited: { tooltip.hide() } @@ -155,7 +156,7 @@ Cura.ExpandablePopup id: tooltip width: 250 * screenScaleFactor - tooltipText: connectionStatusMessage + tooltipText: getConnectionStatusMessage() arrowSize: UM.Theme.getSize("button_tooltip_arrow").width x: connectionStatusImage.x - UM.Theme.getSize("narrow_margin").width y: connectionStatusImage.y + connectionStatusImage.height + UM.Theme.getSize("narrow_margin").height