Fix bottom text and info layout in albums.

This commit is contained in:
John Preston 2024-08-16 11:16:18 +02:00
parent 62a20ba975
commit 754b3a5ae8
2 changed files with 6 additions and 7 deletions

View file

@ -831,7 +831,7 @@ QSize Message::performCountOptimalSize() {
refreshReactions();
}
refreshRightBadge();
refreshInfoSkipBlock();
refreshInfoSkipBlock(textItem);
const auto botTop = item->isFakeAboutView()
? Get<FakeBotAboutTop>()
@ -4485,17 +4485,16 @@ QSize Message::performCountCurrentSize(int newWidth) {
return { newWidth, newHeight };
}
void Message::refreshInfoSkipBlock() {
const auto item = data();
void Message::refreshInfoSkipBlock(HistoryItem *textItem) {
const auto media = this->media();
const auto hasTextSkipBlock = [&] {
if (item->_text.empty()) {
if (!textItem || textItem->_text.empty()) {
if (const auto media = data()->media()) {
return media->storyExpired();
}
return false;
} else if (item->Has<HistoryMessageLogEntryOriginal>()
|| factcheckBlock()) {
} else if (factcheckBlock()
|| data()->Has<HistoryMessageLogEntryOriginal>()) {
return false;
} else if (media && media->isDisplayed() && !_invertMedia) {
return false;

View file

@ -285,7 +285,7 @@ private:
void ensureRightAction() const;
void refreshTopicButton();
void refreshInfoSkipBlock();
void refreshInfoSkipBlock(HistoryItem *textItem);
[[nodiscard]] int monospaceMaxWidth() const;
void validateInlineKeyboard(HistoryMessageReplyMarkup *markup);