From ea9caa69f6a7f3b39839162f5c96418d0d5ff97c Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 6 Sep 2019 17:21:41 -0400 Subject: [PATCH] Change cursor shape when image hovered --- src/qml/Chat/Timeline/EventContent.qml | 4 +++- src/qml/Chat/Timeline/EventDelegate.qml | 4 +--- src/qml/Chat/Timeline/EventImage.qml | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/qml/Chat/Timeline/EventContent.qml b/src/qml/Chat/Timeline/EventContent.qml index 0bbddde3..ba76e64f 100644 --- a/src/qml/Chat/Timeline/EventContent.qml +++ b/src/qml/Chat/Timeline/EventContent.qml @@ -14,8 +14,10 @@ Row { readonly property string hoveredLink: nameLabel.hoveredLink || contentLabel.hoveredLink + property string hoveredImage: "" + readonly property int cursorShape: - hoveredLink ? Qt.PointingHandCursor : + hoveredLink || hoveredImage ? Qt.PointingHandCursor : nameHover.hovered || contentHover.hovered ? Qt.IBeamCursor : Qt.ArrowCursor diff --git a/src/qml/Chat/Timeline/EventDelegate.qml b/src/qml/Chat/Timeline/EventDelegate.qml index 18162ce1..5becf683 100644 --- a/src/qml/Chat/Timeline/EventDelegate.qml +++ b/src/qml/Chat/Timeline/EventDelegate.qml @@ -50,8 +50,6 @@ Column { readonly property var previewLinks: model.preview_links - property string hoveredImage: "" - function json() { return JSON.stringify( @@ -89,7 +87,7 @@ Column { acceptedButtons: Qt.RightButton onTapped: { contextMenu.link = eventContent.hoveredLink - contextMenu.image = eventDelegate.hoveredImage + contextMenu.image = eventContent.hoveredImage contextMenu.popup() } } diff --git a/src/qml/Chat/Timeline/EventImage.qml b/src/qml/Chat/Timeline/EventImage.qml index 76c1c85e..014c5c04 100644 --- a/src/qml/Chat/Timeline/EventImage.qml +++ b/src/qml/Chat/Timeline/EventImage.qml @@ -20,7 +20,8 @@ HImage { HoverHandler { id: hover - onHoveredChanged: eventDelegate.hoveredImage = hovered ? image.source : "" + onHoveredChanged: + eventContent.hoveredImage = hovered ? image.source : "" } MouseArea {