summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authortastytea <tastytea@tastytea.de>2022-03-09 10:25:23 +0100
committertastytea <tastytea@tastytea.de>2022-03-09 18:42:57 +0100
commitb82b724795f4f35401e5b8d669b6582a78cef4ac (patch)
tree61a7655d7e15ffc7872ca0f2bbf7bd38b6ff79cd /resources
parentTranslated using Weblate (Indonesian) (diff)
downloadnheko-b82b724795f4f35401e5b8d669b6582a78cef4ac.tar.xz
Show long reaction text in tooltip
If the reaction text is elided, it will be shown in the tooltip.
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/Reactions.qml9
1 files changed, 8 insertions, 1 deletions
diff --git a/resources/qml/Reactions.qml b/resources/qml/Reactions.qml

index 63115ec0..f79cfe73 100644 --- a/resources/qml/Reactions.qml +++ b/resources/qml/Reactions.qml
@@ -33,12 +33,19 @@ Flow { implicitWidth: contentItem.childrenRect.width + contentItem.leftPadding * 2 implicitHeight: contentItem.childrenRect.height ToolTip.visible: hovered - ToolTip.text: modelData.users ToolTip.delay: Nheko.tooltipDelay onClicked: { console.debug("Picked " + modelData.key + "in response to " + reactionFlow.eventId + ". selfReactedEvent: " + modelData.selfReactedEvent); room.input.reaction(reactionFlow.eventId, modelData.key); } + Component.onCompleted: { + ToolTip.text = Qt.binding(function() { + if (textMetrics.elidedText === textMetrics.text) { + return modelData.users; + } + return modelData.displayKey + "\n" + modelData.users; + }) + } contentItem: Row { anchors.centerIn: parent