mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-10-25 15:16:15 +00:00
Fix admin ranks in admin list
This commit is contained in:
@@ -172,7 +172,7 @@ void PeerListRowWithLink::rightActionPaint(
|
||||
int outerWidth,
|
||||
bool selected,
|
||||
bool actionSelected) {
|
||||
if (!_action.isEmpty() && (_actionPlaceholder.isEmpty() || selected)) {
|
||||
if (!_action.isEmpty() && ((_actionPlaceholder.isEmpty() && _adminRank.isEmpty()) || selected)) {
|
||||
p.setFont(actionSelected ? st::linkOverFont : st::linkFont);
|
||||
p.setPen(actionSelected ? st::defaultLinkButton.overColor : st::defaultLinkButton.color);
|
||||
p.drawTextLeft(x, y, outerWidth, _action, _actionWidth);
|
||||
@@ -187,6 +187,32 @@ void PeerListRowWithLink::rightActionPaint(
|
||||
}
|
||||
}
|
||||
|
||||
void PeerListRowWithLink::setAdminRank(const QString &rank, bool isCreator) {
|
||||
_adminRank = rank;
|
||||
_isCreator = isCreator;
|
||||
}
|
||||
|
||||
int PeerListRowWithLink::adminRankWidth() const {
|
||||
return st::normalFont->width(_adminRank);
|
||||
}
|
||||
|
||||
void PeerListRowWithLink::paintAdminRank(
|
||||
Painter &p,
|
||||
int x,
|
||||
int y,
|
||||
int outerWidth,
|
||||
bool selected) {
|
||||
if (hasAction() && selected) {
|
||||
return;
|
||||
}
|
||||
p.setPen(_isCreator
|
||||
? st::defaultPeerListItem.statusFgActive
|
||||
: selected
|
||||
? st::defaultPeerListItem.statusFgOver
|
||||
: st::defaultPeerListItem.statusFg);
|
||||
p.drawTextLeft(x, y, outerWidth, _adminRank, adminRankWidth());
|
||||
}
|
||||
|
||||
PeerListGlobalSearchController::PeerListGlobalSearchController(
|
||||
not_null<Main::Session*> session)
|
||||
: _session(session)
|
||||
|
||||
Reference in New Issue
Block a user