mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 06:07:45 +00:00
Reserve space for author icon (#293)
This commit is contained in:
parent
a9919db7fa
commit
1ac48ddfa9
@ -433,6 +433,25 @@ QSize Message::performCountOptimalSize() {
|
|||||||
} else if (replyWidth) {
|
} else if (replyWidth) {
|
||||||
namew += st::msgPadding.right() + replyWidth;
|
namew += st::msgPadding.right() + replyWidth;
|
||||||
}
|
}
|
||||||
|
const auto hasChatTypeIcon = [&]() {
|
||||||
|
if (item->isSponsored()) {
|
||||||
|
return true;
|
||||||
|
} else if (!item->isPost() && item->displayFrom()) {
|
||||||
|
const auto from = item->displayFrom();
|
||||||
|
if (from->isChat() || from->isMegagroup() || from->isChannel()) {
|
||||||
|
return true;
|
||||||
|
} else if (const auto user = from->asUser()) {
|
||||||
|
if (user->isInaccessible()
|
||||||
|
|| (user->isBot() && !user->isSupport() && !user->isRepliesChat())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}();
|
||||||
|
if (hasChatTypeIcon) {
|
||||||
|
namew += st::dialogsChatTypeSkip;
|
||||||
|
}
|
||||||
accumulate_max(maxWidth, namew);
|
accumulate_max(maxWidth, namew);
|
||||||
} else if (via && !displayForwardedFrom()) {
|
} else if (via && !displayForwardedFrom()) {
|
||||||
accumulate_max(maxWidth, st::msgPadding.left() + via->maxWidth + st::msgPadding.right());
|
accumulate_max(maxWidth, st::msgPadding.left() + via->maxWidth + st::msgPadding.right());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user