Fixed height of thumb in EditCaptionBox when media changes to photo.

This commit is contained in:
23rd 2019-06-28 13:53:06 +03:00 committed by John Preston
parent cf8a06302f
commit 5e233dab47
2 changed files with 6 additions and 2 deletions

View File

@ -559,6 +559,7 @@ confirmCaptionArea: InputField(defaultInputField) {
}
confirmBg: windowBgOver;
confirmMaxHeight: 245px;
confirmMaxHeightSkip: 25px;
confirmCompressedSkip: 10px;
supportInfoField: InputField(defaultInputField) {

View File

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