mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix via @bot after name for premium users.
This commit is contained in:
parent
460b4b2de5
commit
d511f2bb90
1 changed files with 15 additions and 6 deletions
|
@ -556,12 +556,11 @@ QSize Message::performCountOptimalSize() {
|
||||||
: item->hiddenSenderInfo()->nameText();
|
: item->hiddenSenderInfo()->nameText();
|
||||||
auto namew = st::msgPadding.left()
|
auto namew = st::msgPadding.left()
|
||||||
+ name.maxWidth()
|
+ name.maxWidth()
|
||||||
+ (_fromNameStatus
|
+ (_fromNameStatus ? st::dialogsPremiumIcon.width() : 0)
|
||||||
? st::dialogsPremiumIcon.width()
|
|
||||||
: 0)
|
|
||||||
+ st::msgPadding.right();
|
+ st::msgPadding.right();
|
||||||
if (via && !displayForwardedFrom()) {
|
if (via && !displayForwardedFrom()) {
|
||||||
namew += st::msgServiceFont->spacew + via->maxWidth;
|
namew += st::msgServiceFont->spacew + via->maxWidth
|
||||||
|
+ (_fromNameStatus ? st::msgServiceFont->spacew : 0);
|
||||||
}
|
}
|
||||||
const auto replyWidth = hasFastReply()
|
const auto replyWidth = hasFastReply()
|
||||||
? st::msgFont->width(FastReplyText())
|
? st::msgFont->width(FastReplyText())
|
||||||
|
@ -1117,7 +1116,9 @@ void Message::paintFromName(
|
||||||
}
|
}
|
||||||
return &info->nameText();
|
return &info->nameText();
|
||||||
}();
|
}();
|
||||||
const auto statusWidth = _fromNameStatus ? st::dialogsPremiumIcon.width() : 0;
|
const auto statusWidth = _fromNameStatus
|
||||||
|
? st::dialogsPremiumIcon.width()
|
||||||
|
: 0;
|
||||||
if (statusWidth && availableWidth > statusWidth) {
|
if (statusWidth && availableWidth > statusWidth) {
|
||||||
const auto x = availableLeft
|
const auto x = availableLeft
|
||||||
+ std::min(availableWidth - statusWidth, nameText->maxWidth());
|
+ std::min(availableWidth - statusWidth, nameText->maxWidth());
|
||||||
|
@ -1165,7 +1166,11 @@ void Message::paintFromName(
|
||||||
p.setFont(st::msgNameFont);
|
p.setFont(st::msgNameFont);
|
||||||
p.setPen(nameFg);
|
p.setPen(nameFg);
|
||||||
nameText->drawElided(p, availableLeft, trect.top(), availableWidth);
|
nameText->drawElided(p, availableLeft, trect.top(), availableWidth);
|
||||||
const auto skipWidth = nameText->maxWidth() + st::msgServiceFont->spacew;
|
const auto skipWidth = nameText->maxWidth()
|
||||||
|
+ (_fromNameStatus
|
||||||
|
? (st::dialogsPremiumIcon.width() + st::msgServiceFont->spacew)
|
||||||
|
: 0)
|
||||||
|
+ st::msgServiceFont->spacew;
|
||||||
availableLeft += skipWidth;
|
availableLeft += skipWidth;
|
||||||
availableWidth -= skipWidth;
|
availableWidth -= skipWidth;
|
||||||
|
|
||||||
|
@ -2878,6 +2883,10 @@ void Message::fromNameUpdated(int width) const {
|
||||||
- st::msgPadding.left()
|
- st::msgPadding.left()
|
||||||
- st::msgPadding.right()
|
- st::msgPadding.right()
|
||||||
- nameText->maxWidth()
|
- nameText->maxWidth()
|
||||||
|
+ (_fromNameStatus
|
||||||
|
? (st::dialogsPremiumIcon.width()
|
||||||
|
+ st::msgServiceFont->spacew)
|
||||||
|
: 0)
|
||||||
- st::msgServiceFont->spacew);
|
- st::msgServiceFont->spacew);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue