mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-04-24 12:24:02 +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() {
|
void EditCaptionBox::updateBoxSize() {
|
||||||
auto footerHeight = 0;
|
auto footerHeight = 0;
|
||||||
|
footerHeight += st::normalFont->height + errorTopSkip();
|
||||||
if (_field) {
|
if (_field) {
|
||||||
footerHeight += st::boxPhotoCaptionSkip + _field->height();
|
footerHeight += st::boxPhotoCaptionSkip + _field->height();
|
||||||
}
|
}
|
||||||
@ -613,13 +614,15 @@ void EditCaptionBox::paintEvent(QPaintEvent *e) {
|
|||||||
void EditCaptionBox::resizeEvent(QResizeEvent *e) {
|
void EditCaptionBox::resizeEvent(QResizeEvent *e) {
|
||||||
BoxContent::resizeEvent(e);
|
BoxContent::resizeEvent(e);
|
||||||
|
|
||||||
|
const auto errorHeight = st::normalFont->height + errorTopSkip();
|
||||||
auto bottom = height();
|
auto bottom = height();
|
||||||
{
|
{
|
||||||
const auto resultScrollHeight = bottom
|
const auto resultScrollHeight = bottom
|
||||||
- _field->height()
|
- _field->height()
|
||||||
- st::boxPhotoCaptionSkip
|
- st::boxPhotoCaptionSkip
|
||||||
- (_controls->isHidden() ? 0 : _controls->heightNoMargins())
|
- (_controls->isHidden() ? 0 : _controls->heightNoMargins())
|
||||||
- st::boxPhotoPadding.top();
|
- st::boxPhotoPadding.top()
|
||||||
|
- errorHeight;
|
||||||
const auto minThumbH = st::sendBoxAlbumGroupSize.height()
|
const auto minThumbH = st::sendBoxAlbumGroupSize.height()
|
||||||
+ st::sendBoxAlbumGroupSkipTop * 2;
|
+ st::sendBoxAlbumGroupSkipTop * 2;
|
||||||
const auto diff = resultScrollHeight - minThumbH;
|
const auto diff = resultScrollHeight - minThumbH;
|
||||||
@ -628,6 +631,7 @@ void EditCaptionBox::resizeEvent(QResizeEvent *e) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bottom -= errorHeight;
|
||||||
_field->resize(st::sendMediaPreviewSize, _field->height());
|
_field->resize(st::sendMediaPreviewSize, _field->height());
|
||||||
_field->moveToLeft(
|
_field->moveToLeft(
|
||||||
st::boxPhotoPadding.left(),
|
st::boxPhotoPadding.left(),
|
||||||
|
@ -55,7 +55,7 @@ EdgeButton::EdgeButton(
|
|||||||
const style::RippleAnimation &st)
|
const style::RippleAnimation &st)
|
||||||
: Ui::RippleButton(parent, st)
|
: Ui::RippleButton(parent, st)
|
||||||
, _fg(fg)
|
, _fg(fg)
|
||||||
, _text(st::semiboldTextStyle, text.toUpper())
|
, _text(st::semiboldTextStyle, text)
|
||||||
, _width(_text.maxWidth()
|
, _width(_text.maxWidth()
|
||||||
+ st::photoEditorTextButtonPadding.left()
|
+ st::photoEditorTextButtonPadding.left()
|
||||||
+ st::photoEditorTextButtonPadding.right())
|
+ st::photoEditorTextButtonPadding.right())
|
||||||
|
Loading…
Reference in New Issue
Block a user