From f57ef43dc7893234552ea76eaeba866e764be3ca Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 4 Mar 2022 17:22:19 +0300 Subject: [PATCH] Fixed minimal height of image thumbnail in EditCaptionBox. --- Telegram/SourceFiles/boxes/edit_caption_box.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Telegram/SourceFiles/boxes/edit_caption_box.cpp b/Telegram/SourceFiles/boxes/edit_caption_box.cpp index e5a438b9df..629b451fdd 100644 --- a/Telegram/SourceFiles/boxes/edit_caption_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_caption_box.cpp @@ -614,6 +614,19 @@ void EditCaptionBox::resizeEvent(QResizeEvent *e) { BoxContent::resizeEvent(e); auto bottom = height(); + { + const auto resultScrollHeight = bottom + - _field->height() + - st::boxPhotoCaptionSkip + - (_controls->isHidden() ? 0 : _controls->heightNoMargins()) + - st::boxPhotoPadding.top(); + const auto minThumbH = st::sendBoxAlbumGroupSize.height() + + st::sendBoxAlbumGroupSkipTop * 2; + const auto diff = resultScrollHeight - minThumbH; + if (diff < 0) { + bottom -= diff; + } + } _field->resize(st::sendMediaPreviewSize, _field->height()); _field->moveToLeft(