diff --git a/Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp b/Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp index f7cbff178f..809a74eaf1 100644 --- a/Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp +++ b/Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp @@ -259,9 +259,9 @@ void PaintRow( not_null entry, VideoUserpic *videoUserpic, PeerData *from, - PeerBadge &fromBadge, + PeerBadge &rowBadge, Fn customEmojiRepaint, - const Text::String &fromName, + const Text::String &rowName, const HiddenSenderInfo *hiddenSenderInfo, HistoryItem *item, const Data::Draft *draft, @@ -626,10 +626,10 @@ void PaintRow( p.drawTextLeft(rectForName.left(), rectForName.top(), context.width, text); } else if (from) { if ((history || sublist) && !context.search) { - const auto badgeWidth = fromBadge.drawGetWidth( + const auto badgeWidth = rowBadge.drawGetWidth( p, rectForName, - fromName.maxWidth(), + rowName.maxWidth(), context.width, { .peer = from, @@ -663,7 +663,7 @@ void PaintRow( : context.selected ? st::dialogsNameFgOver : st::dialogsNameFg); - fromName.drawElided(p, rectForName.left(), rectForName.top(), rectForName.width()); + rowName.drawElided(p, rectForName.left(), rectForName.top(), rectForName.width()); } else if (hiddenSenderInfo) { p.setPen(context.active ? st::dialogsNameFgActive @@ -681,12 +681,7 @@ void PaintRow( : (context.selected ? st::dialogsNameFgOver : st::dialogsNameFg)); - auto text = entry->chatListName(); // TODO feed name with emoji - auto textWidth = st::semiboldFont->width(text); - if (textWidth > rectForName.width()) { - text = st::semiboldFont->elided(text, rectForName.width()); - } - p.drawTextLeft(rectForName.left(), rectForName.top(), context.width, text); + rowName.drawElided(p, rectForName.left(), rectForName.top(), rectForName.width()); } }