From 5108955df20a8e73e9c02b9e32a62177f03dc7e8 Mon Sep 17 00:00:00 2001 From: Malte E <97891689+maltee1@users.noreply.github.com> Date: Thu, 24 Feb 2022 03:16:39 +0100 Subject: making userName_ an AbstractButton should play nicely with ListView (#961) * making userName_ an AbstractButton should make it play nicely with the ListView * make Avatar an AbstractButton * make userName_ in Reply.qml an AbstractButton * use alias for avatar background color and fix margin of username in reply --- resources/qml/MessageView.qml | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) (limited to 'resources/qml/MessageView.qml') diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml index 542304d8..7f2a2f57 100644 --- a/resources/qml/MessageView.qml +++ b/resources/qml/MessageView.qml @@ -302,14 +302,9 @@ Item { displayName: userName userid: userId onClicked: room.openUserProfile(userId) - ToolTip.visible: avatarHover.hovered + ToolTip.visible: messageUserAvatar.hovered ToolTip.delay: Nheko.tooltipDelay ToolTip.text: userid - - HoverHandler { - id: avatarHover - } - } Connections { @@ -323,31 +318,23 @@ Item { target: chat.model } - - Label { - id: userName_ - - text: TimelineManager.escapeEmoji(userName) - color: TimelineManager.userColor(userId, Nheko.colors.base) - textFormat: Text.RichText - ToolTip.visible: displayNameHover.hovered + AbstractButton { + contentItem: Label { + id: userName_ + text: TimelineManager.escapeEmoji(userName) + color: TimelineManager.userColor(userId, Nheko.colors.base) + textFormat: Text.RichText + } + ToolTip.visible: hovered ToolTip.delay: Nheko.tooltipDelay ToolTip.text: userId - - TapHandler { - onSingleTapped: chat.model.openUserProfile(userId) - dragThreshold: 0 - } + onClicked: chat.model.openUserProfile(userId) CursorShape { anchors.fill: parent cursorShape: Qt.PointingHandCursor } - HoverHandler { - id: displayNameHover - } - } Label { -- cgit 1.5.1