diff --git a/Telegram/SourceFiles/data/data_folder.cpp b/Telegram/SourceFiles/data/data_folder.cpp index 29ccfba03..10645139b 100644 --- a/Telegram/SourceFiles/data/data_folder.cpp +++ b/Telegram/SourceFiles/data/data_folder.cpp @@ -102,7 +102,6 @@ void Folder::indexNameParts() { } void Folder::registerOne(not_null history) { - ++_chatListViewVersion; if (_chatsList.indexed()->size() == 1) { updateChatListSortPosition(); if (!_cloudUnread.known) { @@ -118,9 +117,6 @@ void Folder::registerOne(not_null history) { void Folder::unregisterOne(not_null history) { if (_chatsList.empty()) { updateChatListExistence(); - } else { - ++_chatListViewVersion; - updateChatListEntry(); } if (_chatListMessage && _chatListMessage->history() == history) { computeChatListMessage(); @@ -360,6 +356,13 @@ void Folder::unreadStateChanged( const Dialogs::Key &key, const Dialogs::UnreadState &wasState, const Dialogs::UnreadState &nowState) { + if (const auto history = key.history()) { + if (wasState.empty() != nowState.empty()) { + ++_chatListViewVersion; + updateChatListEntry(); + } + } + const auto updateCloudUnread = _cloudUnread.known && wasState.known; const auto notify = _chatsList.loaded() || updateCloudUnread; const auto notifier = unreadStateChangeNotifier(notify); diff --git a/Telegram/SourceFiles/dialogs/dialogs.style b/Telegram/SourceFiles/dialogs/dialogs.style index 2eeabe106..a8ff3550e 100644 --- a/Telegram/SourceFiles/dialogs/dialogs.style +++ b/Telegram/SourceFiles/dialogs/dialogs.style @@ -72,6 +72,15 @@ dialogsTextPaletteTakenOver: TextPalette(defaultTextPalette) { dialogsTextPaletteTakenActive: TextPalette(defaultTextPalette) { linkFg: dialogsDraftFgActive; } +dialogsTextPaletteArchive: TextPalette(defaultTextPalette) { + linkFg: dialogsArchiveFg; +} +dialogsTextPaletteArchiveOver: TextPalette(defaultTextPalette) { + linkFg: dialogsArchiveFgOver; +} +dialogsTextPaletteArchiveActive: TextPalette(defaultTextPalette) { + linkFg: dialogsTextFgActive; +} dialogsMenuToggle: IconButton { width: 40px; diff --git a/Telegram/SourceFiles/dialogs/dialogs_layout.cpp b/Telegram/SourceFiles/dialogs/dialogs_layout.cpp index e38d4a71b..f16fc404f 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_layout.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_layout.cpp @@ -172,11 +172,17 @@ void PaintListEntryText( return; } row->validateListEntryCache(); - const auto &palette = active - ? st::dialogsTextPaletteActive - : selected - ? st::dialogsTextPaletteOver - : st::dialogsTextPalette; + const auto &palette = row->folder() + ? (active + ? st::dialogsTextPaletteArchiveActive + : selected + ? st::dialogsTextPaletteArchiveOver + : st::dialogsTextPaletteArchive) + : (active + ? st::dialogsTextPaletteActive + : selected + ? st::dialogsTextPaletteOver + : st::dialogsTextPalette); const auto &color = active ? st::dialogsTextFgActive : selected diff --git a/Telegram/SourceFiles/dialogs/dialogs_row.cpp b/Telegram/SourceFiles/dialogs/dialogs_row.cpp index 3be737282..156fcf7c1 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_row.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_row.cpp @@ -35,21 +35,27 @@ QString ComposeFolderListEntryText(not_null folder) { list ) | ranges::view::take( list.size() - (throwAwayLastName ? 1 : 0) - ) | ranges::view::transform([](not_null history) { - return history->peer; - }); + ); + const auto wrapName = [](not_null 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; }();