Return chat type icons.

This commit is contained in:
John Preston 2024-12-20 12:17:26 +04:00
parent 5c301353ec
commit b61e3b580d
3 changed files with 12 additions and 3 deletions

View file

@ -407,9 +407,6 @@ dialogsLockIcon: ThreeStateIcon {
active: icon {{ "emoji/premium_lock", dialogsUnreadBgMutedActive, point(4px, 0px) }};
}
dialogsVerifiedBg: icon{{ "dialogs/dialogs_verified_star", dialogsVerifiedIconBg }};
dialogsVerifiedFg: icon{{ "dialogs/dialogs_verified_check", dialogsVerifiedIconFg }};
dialogsVerifiedPadding: margins(0px, 3px, 0px, 0px);
dialogsVerifiedColors: VerifiedBadge {
height: 20px;
bg: dialogsVerifiedIconBg;

View file

@ -1390,6 +1390,11 @@ void InnerWidget::paintPeerSearchResult(
const auto position = rectForName.topLeft();
const auto skip = result->badge.drawVerified(p, position, st);
rectForName.setLeft(position.x() + skip + st::dialogsChatTypeSkip);
} else if (const auto chatTypeIcon = Ui::ChatTypeIcon(peer, context)) {
chatTypeIcon->paint(p, rectForName.topLeft(), context.width);
rectForName.setLeft(rectForName.left()
+ chatTypeIcon->width()
+ st::dialogsChatTypeSkip);
}
const auto badgeWidth = result->badge.drawGetWidth(
p,

View file

@ -460,6 +460,13 @@ void PaintRow(
const auto position = rectForName.topLeft();
const auto skip = rowBadge.drawVerified(p, position, st);
rectForName.setLeft(position.x() + skip + st::dialogsChatTypeSkip);
} else if (from) {
if (const auto chatTypeIcon = ChatTypeIcon(from, context)) {
chatTypeIcon->paint(p, rectForName.topLeft(), context.width);
rectForName.setLeft(rectForName.left()
+ chatTypeIcon->width()
+ st::dialogsChatTypeSkip);
}
}
auto texttop = context.st->textTop;
if (const auto folder = entry->asFolder()) {