mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-12-14 18:34:49 +00:00
Moved edit folders button from folders menu to context menu.
This commit is contained in:
parent
19ba685cc3
commit
a08e42fb97
@ -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";
|
||||
|
@ -320,17 +320,7 @@ base::unique_qptr<Ui::SideBarButton> 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<Ui::SideBarButton> 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;
|
||||
|
@ -52,6 +52,7 @@ private:
|
||||
void showRemoveBox(FilterId id);
|
||||
void remove(FilterId id, std::vector<not_null<PeerData*>> leave = {});
|
||||
void scrollToButton(not_null<Ui::RpWidget*> widget);
|
||||
void openFiltersSettings();
|
||||
|
||||
const not_null<SessionController*> _session;
|
||||
const not_null<Ui::RpWidget*> _parent;
|
||||
|
Loading…
Reference in New Issue
Block a user