HToolTip component, enter/exit fade effect

This commit is contained in:
miruka 2019-07-09 22:51:52 -04:00
parent 3dd16ba072
commit eeca8b639d
2 changed files with 14 additions and 2 deletions

View File

@ -54,9 +54,8 @@ Rectangle {
hoverEnabled: true hoverEnabled: true
} }
ToolTip { HToolTip {
visible: imageMouseArea.containsMouse visible: imageMouseArea.containsMouse
delay: Qt.styleHints.mousePressAndHoldInterval
HImage { HImage {
id: avatarToolTipImage id: avatarToolTipImage

13
src/qml/Base/HToolTip.qml Normal file
View File

@ -0,0 +1,13 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
ToolTip {
delay: Qt.styleHints.mousePressAndHoldInterval
enter: Transition {
HNumberAnimation { property: "opacity"; from: 0.0; to: 1.0 }
}
exit: Transition {
HNumberAnimation { property: "opacity"; from: 1.0; to: 0.0 }
}
}