From 2ed3bacd9841574f92773a47a776cf60967493a0 Mon Sep 17 00:00:00 2001 From: John Gibbon Date: Fri, 22 Jan 2021 11:14:45 +0100 Subject: [PATCH] Implement viewing Quiz explanations TDLib 1.7 feature --- qml/components/messageContent/MessagePoll.qml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/qml/components/messageContent/MessagePoll.qml b/qml/components/messageContent/MessagePoll.qml index 0aba733..392e09e 100644 --- a/qml/components/messageContent/MessagePoll.qml +++ b/qml/components/messageContent/MessagePoll.qml @@ -230,6 +230,24 @@ MessageContentBase { width: 1 height: Theme.paddingSmall } + Label { + width: parent.width + wrapMode: Text.Wrap + visible: isQuiz && text.length > 0 + text: Emoji.emojify(Functions.enhanceMessageText(pollData.type.explanation) || "", font.pixelSize) + textFormat: Text.StyledText + color: pollMessageComponent.isOwnMessage || pollMessageComponent.highlighted ? Theme.highlightColor : Theme.primaryColor + font.pixelSize: Theme.fontSizeExtraSmall + leftPadding: Theme.iconSizeSmall + bottomPadding: Theme.paddingSmall + Icon { + source: "image://theme/icon-s-high-importance" + asynchronous: true + width: Theme.iconSizeExtraSmall + height: Theme.iconSizeExtraSmall + anchors.verticalCenter: parent.verticalCenter + } + } Item { x: -Theme.horizontalPageMargin/2