diff --git a/Telegram/SourceFiles/history/history_item_components.cpp b/Telegram/SourceFiles/history/history_item_components.cpp index f9e1c403ff..3dc0303079 100644 --- a/Telegram/SourceFiles/history/history_item_components.cpp +++ b/Telegram/SourceFiles/history/history_item_components.cpp @@ -43,6 +43,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "api/api_bot.h" #include "styles/style_widgets.h" #include "styles/style_chat.h" +#include "styles/style_dialogs.h" // dialogsMiniReplyStoryIcon. #include @@ -460,7 +461,14 @@ void HistoryMessageReply::updateName( w += st::msgServiceFont->spacew + replyToVia->maxWidth; } - maxReplyWidth = previewSkip + qMax(w, qMin(replyToText.maxWidth(), int32(st::maxSignatureSize))); + maxReplyWidth = previewSkip + + std::max( + w, + std::min(replyToText.maxWidth(), st::maxSignatureSize)) + + (storyReply + ? (st::dialogsMiniIconSkip + + st::dialogsMiniReplyStoryIcon.icon.width()) + : 0); } else { maxReplyWidth = st::msgDateFont->width(statePhrase()); } @@ -596,14 +604,27 @@ void HistoryMessageReply::paint( ? stm->historyTextFg : st->msgImgReplyBarColor()); holder->prepareCustomEmojiPaint(p, context, replyToText); + auto replyToTextPosition = QPoint( + x + st::msgReplyBarSkip + previewSkip, + y + st::msgReplyPadding.top() + st::msgServiceNameFont->height); + const auto replyToTextPalette = &(inBubble + ? stm->replyTextPalette + : st->imgReplyTextPalette()); + if (storyReply) { + st::dialogsMiniReplyStoryIcon.icon.paint( + p, + replyToTextPosition, + w - st::msgReplyBarSkip - previewSkip, + replyToTextPalette->linkFg->c); + replyToTextPosition += QPoint( + st::dialogsMiniIconSkip + + st::dialogsMiniReplyStoryIcon.icon.width(), + 0); + } replyToText.draw(p, { - .position = QPoint( - x + st::msgReplyBarSkip + previewSkip, - y + st::msgReplyPadding.top() + st::msgServiceNameFont->height), + .position = replyToTextPosition, .availableWidth = w - st::msgReplyBarSkip - previewSkip, - .palette = &(inBubble - ? stm->replyTextPalette - : st->imgReplyTextPalette()), + .palette = replyToTextPalette, .spoiler = Ui::Text::DefaultSpoilerCache(), .now = context.now, .pausedEmoji = (context.paused