Fixed error display in EditCaptionBox.

This commit is contained in:
23rd 2022-03-04 18:48:11 +03:00
parent f57ef43dc7
commit 0e08cffedb
2 changed files with 6 additions and 2 deletions

View File

@ -580,6 +580,7 @@ void EditCaptionBox::captionResized() {
void EditCaptionBox::updateBoxSize() {
auto footerHeight = 0;
footerHeight += st::normalFont->height + errorTopSkip();
if (_field) {
footerHeight += st::boxPhotoCaptionSkip + _field->height();
}
@ -613,13 +614,15 @@ void EditCaptionBox::paintEvent(QPaintEvent *e) {
void EditCaptionBox::resizeEvent(QResizeEvent *e) {
BoxContent::resizeEvent(e);
const auto errorHeight = st::normalFont->height + errorTopSkip();
auto bottom = height();
{
const auto resultScrollHeight = bottom
- _field->height()
- st::boxPhotoCaptionSkip
- (_controls->isHidden() ? 0 : _controls->heightNoMargins())
- st::boxPhotoPadding.top();
- st::boxPhotoPadding.top()
- errorHeight;
const auto minThumbH = st::sendBoxAlbumGroupSize.height()
+ st::sendBoxAlbumGroupSkipTop * 2;
const auto diff = resultScrollHeight - minThumbH;
@ -628,6 +631,7 @@ void EditCaptionBox::resizeEvent(QResizeEvent *e) {
}
}
bottom -= errorHeight;
_field->resize(st::sendMediaPreviewSize, _field->height());
_field->moveToLeft(
st::boxPhotoPadding.left(),

View File

@ -55,7 +55,7 @@ EdgeButton::EdgeButton(
const style::RippleAnimation &st)
: Ui::RippleButton(parent, st)
, _fg(fg)
, _text(st::semiboldTextStyle, text.toUpper())
, _text(st::semiboldTextStyle, text)
, _width(_text.maxWidth()
+ st::photoEditorTextButtonPadding.left()
+ st::photoEditorTextButtonPadding.right())