From b4ef2ce60ca88da7f95cc1985fd609d939fe16a9 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 11 Dec 2021 23:56:24 +0100 Subject: [PATCH] Allow clicking links in replies fixes #529 --- resources/qml/delegates/Reply.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/qml/delegates/Reply.qml b/resources/qml/delegates/Reply.qml index 547044f3..3b62abea 100644 --- a/resources/qml/delegates/Reply.qml +++ b/resources/qml/delegates/Reply.qml @@ -60,7 +60,14 @@ Item { TapHandler { acceptedButtons: Qt.LeftButton - onSingleTapped: room.showEvent(r.eventId) + onSingleTapped: { + let link = reply.child.linkAt(eventPoint.position.x, eventPoint.position.y - userName_.implicitHeight); + if (link) { + Nheko.openLink(link) + } else { + room.showEvent(r.eventId) + } + } gesturePolicy: TapHandler.ReleaseWithinBounds }