2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

First version of the filters side bar.

This commit is contained in:
John Preston
2020-03-03 16:07:22 +04:00
parent 11d31ffc84
commit d4b9b65724
42 changed files with 235 additions and 65 deletions

View File

@@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/peers/edit_peer_info_box.h"
#include "window/window_controller.h"
#include "window/main_window.h"
#include "window/window_filters_menu.h"
#include "info/info_memento.h"
#include "info/info_controller.h"
#include "history/history.h"
@@ -189,6 +190,17 @@ void SessionController::initSupportMode() {
}, lifetime());
}
void SessionController::toggleFiltersMenu(bool enabled) {
if (!enabled == !_filters) {
return;
} else if (enabled) {
_filters = std::make_unique<FiltersMenu>(this);
} else {
_filters = nullptr;
}
_window->sideBarChanged();
}
bool SessionController::uniqueChatsInSearchResults() const {
return session().supportMode()
&& !session().settings().supportAllSearchResults()
@@ -713,6 +725,22 @@ rpl::producer<FullMsgId> SessionController::floatPlayerClosed() const {
return _floatPlayers->closeEvents();
}
int SessionController::filtersWidth() const {
return _filters ? st::windowFiltersWidth : 0;
}
rpl::producer<FilterId> SessionController::activeChatsFilter() const {
return _activeChatsFilter.value();
}
FilterId SessionController::activeChatsFilterCurrent() const {
return _activeChatsFilter.current();
}
void SessionController::setActiveChatsFilter(FilterId id) {
_activeChatsFilter = id;
}
SessionController::~SessionController() = default;
} // namespace Window