tooltip: add tool tips to qt client
Change-Id: I7aeb96f4c8a09a8b8c0b8e6534079e3fa3965941
diff --git a/src/commoncomponents/HoverableRadiusButton.qml b/src/commoncomponents/HoverableRadiusButton.qml
index ef98e07..cdea4ef 100644
--- a/src/commoncomponents/HoverableRadiusButton.qml
+++ b/src/commoncomponents/HoverableRadiusButton.qml
@@ -40,7 +40,7 @@
property string onExitColor: backgroundColor
property alias radius: hoverableButtonBackground.radius
property alias source: hoverableButtonImage.source
- property bool isHovering: false
+ property string toolTipText: ""
radius: height / 2
function enterBtn(){
btnMouseArea.entered()
@@ -54,6 +54,11 @@
function releaseBtn(){
btnMouseArea.released()
}
+
+ ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
+ ToolTip.visible: hovered && (toolTipText.length > 0)
+ ToolTip.text: toolTipText
+
font.pointSize: fontPointSize
font.kerning: true
hoverEnabled: true
@@ -82,11 +87,9 @@
}
onEntered: {
hoverableButtonBackground.color = onEnterColor
- isHovering = true
}
onExited: {
hoverableButtonBackground.color = onExitColor
- isHovering = false
}
}
}