From 24a7e48b75c8e33a5487dd8b8431179fe020d9f6 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 13 Aug 2024 11:05:49 +0200 Subject: [PATCH] Fix reactions layout under a media. --- .../history/view/history_view_message.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index 610107a73..50ee782d8 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -890,12 +890,13 @@ QSize Message::performCountOptimalSize() { accumulate_max( maxWidth, std::min(st::msgMaxWidth, reactionsMaxWidth)); - if (!mediaDisplayed || _viewButton) { - minHeight += st::mediaInBubbleSkip; - } else if (!media->additionalInfoString().isEmpty()) { + if (mediaDisplayed + && !media->additionalInfoString().isEmpty()) { // In round videos in a web page status text is painted // in the bottom left corner, reactions should be below. minHeight += st::msgDateFont->height; + } else { + minHeight += st::mediaInBubbleSkip; } if (maxWidth >= reactionsMaxWidth) { minHeight += _reactions->minHeight(); @@ -4339,12 +4340,13 @@ int Message::resizeContentGetHeight(int newWidth) { newHeight += entry->resizeGetHeight(contentWidth); } if (reactionsInBubble) { - if (!mediaDisplayed || _viewButton) { - newHeight += st::mediaInBubbleSkip; - } else if (!media->additionalInfoString().isEmpty()) { + if (mediaDisplayed + && !media->additionalInfoString().isEmpty()) { // In round videos in a web page status text is painted // in the bottom left corner, reactions should be below. newHeight += st::msgDateFont->height; + } else { + newHeight += st::mediaInBubbleSkip; } newHeight += _reactions->height(); }