From d895f8d77114797363ed0aee26048f22b3667277 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Tue, 20 May 2025 16:23:33 -0400 Subject: [PATCH] Fix right-clicking delegates again I accidentally broke this while trying to dance around the two new overlapping TapHandlers, but this didn't work. What ended up happening is that you couldn't right-click non-message delegates anymore (such as images, files, etc.) I *still* couldn't figure out how to get overlapping TapHandlers to work, so I just switched to a MouseArea instead. This makes everything work as expected now. --- src/timeline/AuthorComponent.qml | 13 ++++++------- src/timeline/MessageDelegate.qml | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/timeline/AuthorComponent.qml b/src/timeline/AuthorComponent.qml index 8d2e45e26..4021305b3 100644 --- a/src/timeline/AuthorComponent.qml +++ b/src/timeline/AuthorComponent.qml @@ -58,20 +58,19 @@ RowLayout { menu.popup(root.QQC2.Overlay.overlay); } - HoverHandler { - cursorShape: Qt.PointingHandCursor - } - // tapping to open profile TapHandler { onTapped: RoomManager.resolveResource(root.author.uri) } // right-clicking/long-press for context menu - TapHandler { - acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad | PointerDevice.Stylus + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.RightButton - onTapped: nameButton.openUserMenu() + cursorShape: Qt.PointingHandCursor + + onPressed: nameButton.openUserMenu() } TapHandler { acceptedDevices: PointerDevice.TouchScreen diff --git a/src/timeline/MessageDelegate.qml b/src/timeline/MessageDelegate.qml index a2c8cba3b..24cced098 100644 --- a/src/timeline/MessageDelegate.qml +++ b/src/timeline/MessageDelegate.qml @@ -148,8 +148,8 @@ MessageDelegateBase { showBackground: root.cardBackground && !NeoChatConfig.compactLayout TapHandler { + acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad | PointerDevice.Stylus acceptedButtons: Qt.RightButton - gesturePolicy: TapHandler.ReleaseWithinBounds onTapped: _private.showMessageMenu() }