From 752f262a555b43eb16f4d3a8bdc9f6abf8da2150 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Sun, 6 Oct 2019 19:10:31 -0700 Subject: [PATCH] Elide reaction button. --- .../Component/Timeline/ReactionDelegate.qml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/imports/Spectral/Component/Timeline/ReactionDelegate.qml b/imports/Spectral/Component/Timeline/ReactionDelegate.qml index 8e825f2e8..38a393fda 100644 --- a/imports/Spectral/Component/Timeline/ReactionDelegate.qml +++ b/imports/Spectral/Component/Timeline/ReactionDelegate.qml @@ -12,9 +12,18 @@ Flow { model: reaction delegate: Control { + width: Math.min(implicitWidth, 128) + horizontalPadding: 6 verticalPadding: 0 + contentItem: Label { + text: modelData.reaction + (modelData.count > 1 ? " " + modelData.count : "") + color: MPalette.lighter + font.pixelSize: 14 + elide: Text.ElideRight + } + background: Rectangle { radius: height / 2 color: modelData.hasLocalUser ? (MSettings.darkTheme ? Qt.darker(MPalette.accent, 1.55) : Qt.lighter(MPalette.accent, 1.55)) : MPalette.banner @@ -46,12 +55,6 @@ Flow { onClicked: currentRoom.toggleReaction(eventId, modelData.reaction) } } - - contentItem: Label { - text: modelData.reaction + (modelData.count > 1 ? " " + modelData.count : "") - color: MPalette.lighter - font.pixelSize: 14 - } } } }