Fix date and forward bar overlapping.

This commit is contained in:
John Preston 2023-02-02 10:48:35 +04:00
parent a4cdd83816
commit e950130da6
1 changed files with 4 additions and 1 deletions

View File

@ -99,7 +99,10 @@ QSize UnwrappedMedia::countCurrentSize(int newWidth) {
const auto optimalw = maxWidth() - additional;
const auto additionalMinWidth = std::min(additional, st::msgReplyPadding.left() + st::msgMinWidth / 2);
_additionalOnTop = (optimalw + additionalMinWidth) > newWidth;
const auto surrounding = surroundingInfo(topic, via, reply, forwarded, additional);
const auto surroundingWidth = _additionalOnTop
? std::min(newWidth - st::msgReplyPadding.left(), additional)
: (newWidth - _contentSize.width() - st::msgReplyPadding.left());
const auto surrounding = surroundingInfo(topic, via, reply, forwarded, surroundingWidth);
if (_additionalOnTop) {
_topAdded = surrounding.height + st::msgMargin.bottom();
newHeight += _topAdded;