2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Show unread archive chat names in bold.

This commit is contained in:
John Preston
2019-05-08 12:05:15 +03:00
parent e55e46a0f0
commit 64dd5139da
4 changed files with 38 additions and 14 deletions

View File

@@ -35,21 +35,27 @@ QString ComposeFolderListEntryText(not_null<Data::Folder*> folder) {
list
) | ranges::view::take(
list.size() - (throwAwayLastName ? 1 : 0)
) | ranges::view::transform([](not_null<History*> history) {
return history->peer;
});
);
const auto wrapName = [](not_null<History*> history) {
const auto name = TextUtilities::Clean(App::peerName(history->peer));
return (history->unreadCount() > 0)
? (textcmdStartSemibold()
+ textcmdLink(1, name)
+ textcmdStopSemibold())
: name;
};
const auto shown = int(peers.size());
const auto accumulated = [&] {
Expects(shown > 0);
auto i = peers.begin();
auto result = App::peerName(*i);
auto result = wrapName(*i);
for (++i; i != peers.end(); ++i) {
result = lng_archived_last_list(
lt_accumulated,
result,
lt_chat,
App::peerName(*i));
wrapName(*i));
}
return result;
}();