From 5e233dab4735123a25d8e4239f0333b30175c421 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 28 Jun 2019 13:53:06 +0300 Subject: [PATCH] Fixed height of thumb in EditCaptionBox when media changes to photo. --- Telegram/SourceFiles/boxes/boxes.style | 1 + Telegram/SourceFiles/boxes/edit_caption_box.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/boxes/boxes.style b/Telegram/SourceFiles/boxes/boxes.style index 0ccbffa79..27278b8df 100644 --- a/Telegram/SourceFiles/boxes/boxes.style +++ b/Telegram/SourceFiles/boxes/boxes.style @@ -559,6 +559,7 @@ confirmCaptionArea: InputField(defaultInputField) { } confirmBg: windowBgOver; confirmMaxHeight: 245px; +confirmMaxHeightSkip: 25px; confirmCompressedSkip: 10px; supportInfoField: InputField(defaultInputField) { diff --git a/Telegram/SourceFiles/boxes/edit_caption_box.cpp b/Telegram/SourceFiles/boxes/edit_caption_box.cpp index 442f30fc8..967731cda 100644 --- a/Telegram/SourceFiles/boxes/edit_caption_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_caption_box.cpp @@ -440,13 +440,16 @@ void EditCaptionBox::updateEditPreview() { _doc = true; } - _wayWrap->toggle(_photo && !_isAlbum, anim::type::instant); + const auto showCheckbox = _photo && !_isAlbum; + _wayWrap->toggle(showCheckbox, anim::type::instant); if (!_doc) { _thumb = App::pixmapFromImageInPlace( file->preview.scaled( st::sendMediaPreviewSize * cIntRetinaFactor(), - st::confirmMaxHeight * cIntRetinaFactor(), + (st::confirmMaxHeight - (showCheckbox + ? st::confirmMaxHeightSkip + : 0)) * cIntRetinaFactor(), Qt::KeepAspectRatio)); _thumbw = _thumb.width() / cIntRetinaFactor(); _thumbh = _thumb.height() / cIntRetinaFactor();