From eeca8b639df5d83aa5a46de0475002f02e7f1544 Mon Sep 17 00:00:00 2001 From: miruka Date: Tue, 9 Jul 2019 22:51:52 -0400 Subject: [PATCH] HToolTip component, enter/exit fade effect --- src/qml/Base/HAvatar.qml | 3 +-- src/qml/Base/HToolTip.qml | 13 +++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 src/qml/Base/HToolTip.qml diff --git a/src/qml/Base/HAvatar.qml b/src/qml/Base/HAvatar.qml index 5c738423..951e2098 100644 --- a/src/qml/Base/HAvatar.qml +++ b/src/qml/Base/HAvatar.qml @@ -54,9 +54,8 @@ Rectangle { hoverEnabled: true } - ToolTip { + HToolTip { visible: imageMouseArea.containsMouse - delay: Qt.styleHints.mousePressAndHoldInterval HImage { id: avatarToolTipImage diff --git a/src/qml/Base/HToolTip.qml b/src/qml/Base/HToolTip.qml new file mode 100644 index 00000000..81478116 --- /dev/null +++ b/src/qml/Base/HToolTip.qml @@ -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 } + } +}