summary refs log tree commit diff
path: root/resources/qml/MessageView.qml
diff options
context:
space:
mode:
authorMalte E <97891689+maltee1@users.noreply.github.com>2022-02-24 03:16:39 +0100
committerGitHub <noreply@github.com>2022-02-24 02:16:39 +0000
commit5108955df20a8e73e9c02b9e32a62177f03dc7e8 (patch)
treec89850182dd9168710f3c8e6638d739e08f66cbb /resources/qml/MessageView.qml
parentMerge pull request #956 from maltee1/mobile_room_directory (diff)
downloadnheko-5108955df20a8e73e9c02b9e32a62177f03dc7e8.tar.xz
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
Diffstat (limited to 'resources/qml/MessageView.qml')
-rw-r--r--resources/qml/MessageView.qml33
1 files changed, 10 insertions, 23 deletions
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 {