diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index acfe54a1d4..9730225d2b 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -3587,6 +3587,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_filters_restore" = "Undo"; "lng_filters_new" = "New Folder"; "lng_filters_edit" = "Edit Folder"; +"lng_filters_setup_menu" = "Edit Folders"; "lng_filters_new_name" = "Folder name"; "lng_filters_add_chats" = "Add chats"; "lng_filters_remove_chats" = "Remove chats"; diff --git a/Telegram/SourceFiles/window/window_filters_menu.cpp b/Telegram/SourceFiles/window/window_filters_menu.cpp index b606be0534..c6c34a0d94 100644 --- a/Telegram/SourceFiles/window/window_filters_menu.cpp +++ b/Telegram/SourceFiles/window/window_filters_menu.cpp @@ -320,17 +320,7 @@ base::unique_qptr FiltersMenu::prepareButton( } else if (id >= 0) { _session->setActiveChatsFilter(id); } else { - const auto filters = &_session->session().data().chatsFilters(); - if (filters->suggestedLoaded()) { - _session->showSettings(Settings::Folders::Id()); - } else if (!_waitingSuggested) { - _waitingSuggested = true; - filters->requestSuggested(); - filters->suggestedUpdated( - ) | rpl::take(1) | rpl::start_with_next([=] { - _session->showSettings(Settings::Folders::Id()); - }, _outer.lifetime()); - } + openFiltersSettings(); } }); if (id >= 0) { @@ -368,6 +358,20 @@ base::unique_qptr FiltersMenu::prepareButton( return button; } +void FiltersMenu::openFiltersSettings() { + const auto filters = &_session->session().data().chatsFilters(); + if (filters->suggestedLoaded()) { + _session->showSettings(Settings::Folders::Id()); + } else if (!_waitingSuggested) { + _waitingSuggested = true; + filters->requestSuggested(); + filters->suggestedUpdated( + ) | rpl::take(1) | rpl::start_with_next([=] { + _session->showSettings(Settings::Folders::Id()); + }, _outer.lifetime()); + } +} + void FiltersMenu::showMenu(QPoint position, FilterId id) { if (_popupMenu) { _popupMenu = nullptr; @@ -418,6 +422,11 @@ void FiltersMenu::showMenu(QPoint position, FilterId id) { [=] { return _session->session().data().chatsList(); }, addAction, std::move(customUnreadState)); + + addAction( + tr::lng_filters_setup_menu(tr::now), + [=] { openFiltersSettings(); }, + &st::menuIconEdit); } if (_popupMenu->empty()) { _popupMenu = nullptr; diff --git a/Telegram/SourceFiles/window/window_filters_menu.h b/Telegram/SourceFiles/window/window_filters_menu.h index a4084164bf..ee71510eaf 100644 --- a/Telegram/SourceFiles/window/window_filters_menu.h +++ b/Telegram/SourceFiles/window/window_filters_menu.h @@ -52,6 +52,7 @@ private: void showRemoveBox(FilterId id); void remove(FilterId id, std::vector> leave = {}); void scrollToButton(not_null widget); + void openFiltersSettings(); const not_null _session; const not_null _parent;