From 9f6e5821111c0451fa0248a1aa5aeedc1e6ffe9c Mon Sep 17 00:00:00 2001 From: hydrogen Date: Mon, 23 Nov 2020 11:50:00 +0200 Subject: [PATCH] feat: support seeing who liked a message --- .../ChatColumn/MessageComponents/EmojiReactions.qml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/EmojiReactions.qml b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/EmojiReactions.qml index bf45d75d03..2d4d22cc86 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/EmojiReactions.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/EmojiReactions.qml @@ -1,4 +1,5 @@ import QtQuick 2.3 +import QtQuick.Controls 2.13 import "../../../../../shared" import "../../../../../imports" @@ -23,11 +24,13 @@ Item { if (!byEmoji[reaction.emojiId]) { byEmoji[reaction.emojiId] = { emojiId: reaction.emojiId, + fromAccounts: [], count: 0, currentUserReacted: false } } byEmoji[reaction.emojiId].count++; + byEmoji[reaction.emojiId].fromAccounts.push(chatsModel.userNameOrAlias(reaction.from)); if (!byEmoji[reaction.emojiId].currentUserReacted && reaction.from === profileModel.profile.pubKey) { byEmoji[reaction.emojiId].currentUserReacted = true } @@ -49,6 +52,11 @@ Item { anchors.leftMargin: (index === 0) ? 0 : root.imageMargin color: modelData.currentUserReacted ? Style.current.primary : Style.current.inputBackground + ToolTip { + visible: mouseArea.containsMouse + text: modelData.fromAccounts.join(", ") + } + // Rounded corner to cover one corner Rectangle { color: parent.color @@ -95,7 +103,9 @@ Item { } MouseArea { + id: mouseArea anchors.fill: parent + hoverEnabled: true cursorShape: Qt.PointingHandCursor onClicked: { chatsModel.toggleEmojiReaction(messageId, modelData.emojiId)