From 7a6c55bd8ae71e45166c034e3ac0c2c22ff1ecc7 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 22 Apr 2024 23:02:53 +0300 Subject: [PATCH] Fixed color of icon for replies with media story. --- .../history/view/history_view_reply.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_reply.cpp b/Telegram/SourceFiles/history/view/history_view_reply.cpp index 5830bf0c5..1b9df5db6 100644 --- a/Telegram/SourceFiles/history/view/history_view_reply.cpp +++ b/Telegram/SourceFiles/history/view/history_view_reply.cpp @@ -761,6 +761,14 @@ void Reply::paint( : useColorIndex ? st->coloredTextPalette(selected, colorIndexPlusOne - 1) : stm->replyTextPalette); + auto owned = std::optional(); + auto copy = std::optional(); + if (inBubble && colorIndexPlusOne) { + copy.emplace(*replyToTextPalette); + owned.emplace(cache->icon); + copy->linkFg = owned->color(); + replyToTextPalette = &*copy; + } if (_replyToStory) { st::dialogsMiniReplyStory.icon.icon.paint( p, @@ -771,14 +779,6 @@ void Reply::paint( firstLineSkip += st::dialogsMiniReplyStory.skipText + st::dialogsMiniReplyStory.icon.icon.width(); } - auto owned = std::optional(); - auto copy = std::optional(); - if (inBubble && colorIndexPlusOne) { - copy.emplace(*replyToTextPalette); - owned.emplace(cache->icon); - copy->linkFg = owned->color(); - replyToTextPalette = &*copy; - } _text.draw(p, { .position = { textLeft, textTop }, .geometry = textGeometry(textw, firstLineSkip),