Replace MouseAreas by input handlers

This commit is contained in:
miruka 2019-07-12 18:02:14 -04:00
parent cb0d7e8a77
commit cc937b38c4
2 changed files with 7 additions and 12 deletions

View File

@ -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

View File

@ -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() }
}
}