diff --git a/src/qml/Base/HAvatar.qml b/src/qml/Base/HAvatar.qml index fe49c27e..10442080 100644 --- a/src/qml/Base/HAvatar.qml +++ b/src/qml/Base/HAvatar.qml @@ -1,7 +1,7 @@ // Copyright 2019 miruka // This file is part of harmonyqml, licensed under LGPLv3. -import QtQuick 2.7 +import QtQuick 2.12 import QtQuick.Controls 2.0 import "../Base" import "../utils.js" as Utils @@ -48,16 +48,13 @@ HRectangle { sourceSize.width: dimension sourceSize.height: dimension - MouseArea { - id: imageMouseArea - anchors.fill: parent - hoverEnabled: true - propagateComposedEvents: true + HoverHandler { + id: hoverHandler } HToolTip { id: avatarToolTip - visible: imageMouseArea.containsMouse + visible: hoverHandler.hovered width: 128 height: 128 diff --git a/src/qml/Base/HToolTip.qml b/src/qml/Base/HToolTip.qml index 833c62f7..1d0dd30a 100644 --- a/src/qml/Base/HToolTip.qml +++ b/src/qml/Base/HToolTip.qml @@ -1,4 +1,4 @@ -import QtQuick 2.7 +import QtQuick 2.12 import QtQuick.Controls 2.0 ToolTip { @@ -16,9 +16,7 @@ ToolTip { HNumberAnimation { property: "opacity"; from: 1.0; to: 0.0 } } - MouseArea { - anchors.fill: parent - propagateComposedEvents: true - onClicked: { toolTip.close(); mouse.accepted = false } + TapHandler { + onTapped: { toolTip.hide() } } }