mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-04-23 07:37:34 +00:00
Fixed error display in EditCaptionBox.
This commit is contained in:
parent
f57ef43dc7
commit
0e08cffedb
@ -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(),
|
||||
|
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user