From 0c21eba1f8adef78da688f6420d0ca3a89d5f0b6 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 23 Nov 2024 05:11:13 +0300 Subject: [PATCH] Fixed display of preview for sticker packs. --- .../history/view/media/history_view_web_page.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp b/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp index c9980a817..90aa91503 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp @@ -630,10 +630,13 @@ QSize WebPage::countOptimalSize() { _durationWidth = st::msgDateFont->width(_duration); } if (!_openButton.isEmpty()) { - accumulate_max( - maxWidth, - rect::m::sum::h(st::historyPageButtonPadding) - + _openButton.maxWidth()); + const auto w = rect::m::sum::h(st::historyPageButtonPadding) + + _openButton.maxWidth(); + if (sponsored) { + accumulate_max(maxWidth, w); + } else { + maxWidth += w; + } } maxWidth += rect::m::sum::h(padding); minHeight += rect::m::sum::v(padding);