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:
@@ -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
|
||||
|
Reference in New Issue
Block a user