Fixed count of current size for non-thumbed media with long bottom info.

This commit is contained in:
23rd 2024-11-29 15:55:08 +03:00
parent 5aba2f25cc
commit cdd7ff5c6d

View file

@ -543,12 +543,21 @@ QSize Document::countCurrentSize(int newWidth) {
if (!captioned && !hasTranscribe) {
auto result = File::countCurrentSize(newWidth);
if (isBubbleBottom()) {
if (const auto link = thumbedLinkMaxWidth()) {
const auto thumbedWidth = thumbedLinkMaxWidth();
const auto statusWidth = thumbedWidth
? 0
: st::normalFont->width(_statusText);
if (thumbedWidth || statusWidth) {
const auto needed = st.padding.left()
+ st.thumbSize
+ st.thumbSkip
+ link
+ (thumbedWidth
? st.thumbSize + st.thumbSkip
: st::msgFileLayout.thumbSize
+ st::mediaUnreadSkip)
+ (thumbedWidth + statusWidth)
+ st.thumbSkip
+ (_realParent->hasUnreadMediaFlag()
? st::mediaUnreadSkip + st::mediaUnreadSize
: 0)
+ _parent->bottomInfoFirstLineWidth()
+ st.padding.right();
if (result.width() < needed) {