moment/src/qml/Base/HToolTip.qml
miruka 29107ca7f2 Hide tooltips when they're not hovered anymore
Fix hovered avatar staying visible when cursor goes outside of window
(in most cases)
2019-07-24 15:59:34 -04:00

27 lines
572 B
QML

import QtQuick 2.12
import QtQuick.Controls 2.12
ToolTip {
// Be sure to have a width and height set, to prevent the tooltip from
// going out of the window's boundaries
id: toolTip
delay: 150
padding: 0
enter: Transition {
HNumberAnimation { property: "opacity"; from: 0.0; to: 1.0 }
}
exit: Transition {
HNumberAnimation { property: "opacity"; from: 1.0; to: 0.0 }
}
TapHandler {
onTapped: { toolTip.hide() }
}
HoverHandler {
onHoveredChanged: if (!hovered) { toolTip.hide() }
}
}