From 3c0ee9fa20501709b9f1f116457a99963c765a55 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 18 Mar 2020 12:13:12 +0400 Subject: [PATCH] Fix filter chats list edit box title. --- .../SourceFiles/boxes/filters/edit_filter_chats_list.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.cpp b/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.cpp index 7650c00bf..c425ff364 100644 --- a/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.cpp +++ b/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.cpp @@ -357,6 +357,7 @@ void EditFilterChatsListController::prepareViewHook() { delegate()->peerListSetAboveWidget(prepareTypesList()); delegate()->peerListAddSelectedPeers( _peers | ranges::view::transform(&History::peer)); + updateTitle(); } object_ptr EditFilterChatsListController::prepareTypesList() { @@ -419,7 +420,13 @@ auto EditFilterChatsListController::createRow(not_null history) } void EditFilterChatsListController::updateTitle() { - const auto count = delegate()->peerListSelectedRowsCount(); + auto types = 0; + for (const auto flag : kAllTypes) { + if (_selected & flag) { + ++types; + } + } + const auto count = delegate()->peerListSelectedRowsCount() - types; const auto additional = qsl("%1 / %2").arg(count).arg(kMaxExceptions); delegate()->peerListSetAdditionalTitle(rpl::single(additional)); }