Don't show user badge in star stats rows.

This commit is contained in:
John Preston 2024-10-10 11:25:54 +04:00
parent 88703ba1eb
commit 828ecabc78
3 changed files with 10 additions and 3 deletions

View file

@ -764,13 +764,14 @@ int PeerListRow::paintNameIconGetWidth(
int availableWidth,
int outerWidth,
bool selected) {
if (special()
if (_skipPeerBadge
|| special()
|| !_savedMessagesStatus.isEmpty()
|| _isRepliesMessagesChat
|| _isVerifyCodesChat) {
return 0;
}
return _bagde.drawGetWidth(
return _badge.drawGetWidth(
p,
QRect(
nameLeft,

View file

@ -254,6 +254,10 @@ public:
return _nameFirstLetters;
}
void setSkipPeerBadge(bool skip) {
_skipPeerBadge = skip;
}
virtual void lazyInitialize(const style::PeerListItem &st);
virtual void paintStatusText(
Painter &p,
@ -291,7 +295,7 @@ private:
std::unique_ptr<Ui::RoundImageCheckbox> _checkbox;
Ui::Text::String _name;
Ui::Text::String _status;
Ui::PeerBadge _bagde;
Ui::PeerBadge _badge;
StatusType _statusType = StatusType::Online;
crl::time _statusValidTill = 0;
base::flat_set<QChar> _nameFirstLetters;
@ -303,6 +307,7 @@ private:
bool _isSearchResult : 1 = false;
bool _isRepliesMessagesChat : 1 = false;
bool _isVerifyCodesChat : 1 = false;
bool _skipPeerBadge : 1 = false;
};

View file

@ -851,6 +851,7 @@ void CreditsRow::init() {
? name
: _entry.title;
const auto joiner = QString(QChar(' ')) + QChar(8212) + QChar(' ');
setSkipPeerBadge(true);
PeerListRow::setCustomStatus(
langDateTime(_entry.date)
+ (_entry.refunded