Fixed minimal height of image thumbnail in EditCaptionBox.

This commit is contained in:
23rd 2022-03-04 17:22:19 +03:00
parent d5b9effd2e
commit f57ef43dc7
1 changed files with 13 additions and 0 deletions

View File

@ -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(