2019-07-12 18:02:14 -04:00
|
|
|
import QtQuick 2.12
|
2019-07-13 05:39:01 -04:00
|
|
|
import QtQuick.Controls 2.12
|
2019-07-09 22:51:52 -04:00
|
|
|
|
|
|
|
ToolTip {
|
2019-07-09 23:42:03 -04:00
|
|
|
id: toolTip
|
2019-08-22 09:27:26 -04:00
|
|
|
delay: theme.controls.toolTip.delay
|
|
|
|
padding: background.border.width
|
|
|
|
|
2019-08-27 22:46:31 -04:00
|
|
|
background: Rectangle {
|
2019-08-22 09:27:26 -04:00
|
|
|
id: background
|
|
|
|
color: theme.controls.toolTip.background
|
|
|
|
border.color: theme.controls.toolTip.border
|
|
|
|
border.width: theme.controls.toolTip.borderWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
contentItem: HLabel {
|
|
|
|
color: theme.controls.toolTip.text
|
|
|
|
text: toolTip.text
|
|
|
|
leftPadding: theme.spacing / 1.5
|
|
|
|
rightPadding: leftPadding
|
|
|
|
topPadding: theme.spacing / 2
|
|
|
|
bottomPadding: topPadding
|
|
|
|
}
|
2019-07-09 22:51:52 -04:00
|
|
|
|
|
|
|
enter: Transition {
|
|
|
|
HNumberAnimation { property: "opacity"; from: 0.0; to: 1.0 }
|
|
|
|
}
|
|
|
|
exit: Transition {
|
|
|
|
HNumberAnimation { property: "opacity"; from: 1.0; to: 0.0 }
|
|
|
|
}
|
2019-07-09 23:49:59 -04:00
|
|
|
|
2019-07-12 18:02:14 -04:00
|
|
|
TapHandler {
|
|
|
|
onTapped: { toolTip.hide() }
|
2019-07-09 23:49:59 -04:00
|
|
|
}
|
2019-07-24 15:58:43 -04:00
|
|
|
|
|
|
|
HoverHandler {
|
2019-08-22 09:27:26 -04:00
|
|
|
onHoveredChanged: if (! hovered) toolTip.hide()
|
2019-07-24 15:58:43 -04:00
|
|
|
}
|
2019-07-09 22:51:52 -04:00
|
|
|
}
|