Skip to content

Commit

Permalink
Fix bottom text and info layout in albums.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Aug 16, 2024
1 parent 62a20ba commit 754b3a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions Telegram/SourceFiles/history/view/history_view_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ QSize Message::performCountOptimalSize() {
refreshReactions();
}
refreshRightBadge();
refreshInfoSkipBlock();
refreshInfoSkipBlock(textItem);

const auto botTop = item->isFakeAboutView()
? Get<FakeBotAboutTop>()
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/history/view/history_view_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ class Message final : public Element {

void ensureRightAction() const;
void refreshTopicButton();
void refreshInfoSkipBlock();
void refreshInfoSkipBlock(HistoryItem *textItem);
[[nodiscard]] int monospaceMaxWidth() const;

void validateInlineKeyboard(HistoryMessageReplyMarkup *markup);
Expand Down

0 comments on commit 754b3a5

Please sign in to comment.