From cc937b38c4d72f4782639cf5a027a860bd6fe318 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 12 Jul 2019 18:02:14 -0400 Subject: [PATCH] Replace MouseAreas by input handlers --- src/qml/Base/HAvatar.qml | 11 ++++------- src/qml/Base/HToolTip.qml | 8 +++----- 2 files changed, 7 insertions(+), 12 deletions(-) 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() } } }