From 6f5c23b3c3a55002ab5279ef1a9fd7e587f858c0 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Sun, 21 Jul 2019 21:23:14 +0800 Subject: [PATCH] Hover to show reaction sender list. --- .../Component/Timeline/ReactionDelegate.qml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/imports/Spectral/Component/Timeline/ReactionDelegate.qml b/imports/Spectral/Component/Timeline/ReactionDelegate.qml index 1a282d7c5..e536003ba 100644 --- a/imports/Spectral/Component/Timeline/ReactionDelegate.qml +++ b/imports/Spectral/Component/Timeline/ReactionDelegate.qml @@ -16,6 +16,31 @@ RowLayout { background: Rectangle { radius: height / 2 color: modelData.hasLocalUser ? (MSettings.darkTheme ? Qt.darker(MPalette.accent, 1.55) : Qt.lighter(MPalette.accent, 1.55)) : MPalette.banner + + MouseArea { + anchors.fill: parent + + hoverEnabled: true + + ToolTip.visible: containsMouse + ToolTip.text: { + var text = ""; + + for (var i = 0; i < modelData.authors.length; i++) { + if (i === modelData.authors.length - 1 && i !== 0) { + text += " and " + } else if (i !== 0) { + text += ", " + } + + text += modelData.authors[i].displayName + } + + text += " reacted with " + modelData.reaction + + return text + } + } } contentItem: Label {