mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Slightly improved process of switching between chats filters view types.
This commit is contained in:
@@ -1315,17 +1315,20 @@ SessionController::SessionController(
|
||||
}, lifetime());
|
||||
|
||||
rpl::merge(
|
||||
session->data().chatsFilters().changed() | rpl::filter([=] {
|
||||
return session->data().chatsFilters().loaded();
|
||||
}) | rpl::map([] {
|
||||
return Core::App().settings().chatFiltersHorizontalValue(
|
||||
) | rpl::to_empty;
|
||||
}) | rpl::flatten_latest(),
|
||||
Core::App().settings().chatFiltersHorizontalChanges() | rpl::to_empty,
|
||||
session->data().chatsFilters().changed()
|
||||
) | rpl::start_with_next([=] {
|
||||
checkOpenedFilter();
|
||||
crl::on_main(this, [=] {
|
||||
refreshFiltersMenu();
|
||||
crl::on_main(this, [this] {
|
||||
if (SessionNavigation::session().data().chatsFilters().has()) {
|
||||
const auto isHorizontal
|
||||
= Core::App().settings().chatFiltersHorizontal();
|
||||
content()->toggleFiltersMenu(isHorizontal);
|
||||
toggleFiltersMenu(!isHorizontal);
|
||||
} else {
|
||||
content()->toggleFiltersMenu(false);
|
||||
toggleFiltersMenu(false);
|
||||
}
|
||||
});
|
||||
}, lifetime());
|
||||
|
||||
@@ -1556,11 +1559,6 @@ void SessionController::toggleFiltersMenu(bool enabled) {
|
||||
_filtersMenuChanged.fire({});
|
||||
}
|
||||
|
||||
void SessionController::refreshFiltersMenu() {
|
||||
toggleFiltersMenu(session().data().chatsFilters().has()
|
||||
&& !Core::App().settings().chatFiltersHorizontal());
|
||||
}
|
||||
|
||||
rpl::producer<> SessionController::filtersMenuChanged() const {
|
||||
return _filtersMenuChanged.events();
|
||||
}
|
||||
|
@@ -630,7 +630,6 @@ private:
|
||||
|
||||
void init();
|
||||
void setupShortcuts();
|
||||
void refreshFiltersMenu();
|
||||
void checkOpenedFilter();
|
||||
void suggestArchiveAndMute();
|
||||
void activateFirstChatsFilter();
|
||||
|
Reference in New Issue
Block a user