From bcfa6834682b188ab2a315d74529168d5c3968a6 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 18 Jan 2021 20:49:40 +0100 Subject: [PATCH] Improve hover stuff, needs HoverHandler for a proper fix --- resources/qml/TimelineRow.qml | 17 ++++++++++------- resources/qml/delegates/Reply.qml | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml index 077171c9..17dc2cd7 100644 --- a/resources/qml/TimelineRow.qml +++ b/resources/qml/TimelineRow.qml @@ -11,15 +11,23 @@ Item { anchors.right: parent.right height: row.height + Rectangle { + color: (Settings.messageHoverHighlight && hoverHandler.containsMouse) ? colors.alternateBase : "transparent" + anchors.fill: row + } + MouseArea { + id: hoverHandler anchors.fill: parent propagateComposedEvents: true - preventStealing: true + preventStealing: false hoverEnabled: true acceptedButtons: Qt.AllButtons onClicked: { if (mouse.button === Qt.RightButton) - messageContextMenu.show(model.id, model.type, model.isEncrypted, row); + messageContextMenu.show(model.id, model.type, model.isEncrypted, row); + else + event.accepted = false } onPressAndHold: { @@ -27,11 +35,6 @@ Item { } } - Rectangle { - color: (Settings.messageHoverHighlight && parent.containsMouse) ? colors.base : "transparent" - anchors.fill: row - } - RowLayout { id: row diff --git a/resources/qml/delegates/Reply.qml b/resources/qml/delegates/Reply.qml index fe2fe23f..ff1fa657 100644 --- a/resources/qml/delegates/Reply.qml +++ b/resources/qml/delegates/Reply.qml @@ -15,7 +15,7 @@ Item { MouseArea { anchors.fill: parent - preventStealing: true + preventStealing: false onClicked: chat.positionViewAtIndex(chat.model.idToIndex(modelData.id), ListView.Contain) cursorShape: Qt.PointingHandCursor }