Fix the connection status tooltip

CURA-7437
This commit is contained in:
Nino van Hooff 2020-05-26 16:21:51 +02:00
parent 8c28dd8d84
commit 5f574d4b64
2 changed files with 43 additions and 17 deletions

View file

@ -19,6 +19,7 @@ ToolTip
property int contentAlignment: Cura.ToolTip.ContentAlignment.AlignRight
property alias tooltipText: tooltip.text
property alias arrowSize: backgroundRect.arrowSize
property var targetPoint: Qt.point(parent.x, y + Math.round(height/2))
id: tooltip
@ -26,6 +27,11 @@ ToolTip
delay: 500
font: UM.Theme.getFont("default")
Behavior on opacity
{
NumberAnimation { duration: 100; }
}
// If the text is not set, just set the height to 0 to prevent it from showing
height: text != "" ? label.contentHeight + 2 * UM.Theme.getSize("thin_margin").width: 0
@ -60,4 +66,13 @@ ToolTip
color: UM.Theme.getColor("tooltip_text")
renderType: Text.NativeRendering
}
function show() {
visible = true
opacity = 1
}
function hide() {
opacity = 0
}
}