Fixed display of chats filters strip in new windows.

This commit is contained in:
23rd 2024-11-15 10:51:20 +03:00
parent 715874a98f
commit 9d3b3476c2
3 changed files with 12 additions and 3 deletions

View file

@ -1331,6 +1331,7 @@ void Widget::toggleFiltersMenu(bool enabled) {
controller()->setActiveChatsFilter(id);
}
},
controller(),
true);
raw->show();
raw->stackUnder(_scroll);

View file

@ -173,16 +173,19 @@ not_null<Ui::RpWidget*> AddChatFiltersTabsStrip(
not_null<Ui::RpWidget*> parent,
not_null<Main::Session*> session,
Fn<void(FilterId)> choose,
Window::SessionController *controller,
bool trackActiveFilterAndUnreadAndReorder) {
const auto window = Core::App().findWindow(parent);
const auto controller = window ? window->sessionController() : nullptr;
const auto &scrollSt = st::defaultScrollArea;
const auto wrap = Ui::CreateChild<Ui::SlideWrap<Ui::RpWidget>>(
parent,
object_ptr<Ui::RpWidget>(parent));
if (!controller) {
return wrap;
const auto window = Core::App().findWindow(parent);
controller = window ? window->sessionController() : nullptr;
if (!controller) {
return wrap;
}
}
const auto container = wrap->entity();
const auto scroll = Ui::CreateChild<Ui::ScrollArea>(container, scrollSt);

View file

@ -15,12 +15,17 @@ namespace Ui {
class RpWidget;
} // namespace Ui
namespace Window {
class SessionController;
} // namespace Window
namespace Ui {
not_null<Ui::RpWidget*> AddChatFiltersTabsStrip(
not_null<Ui::RpWidget*> parent,
not_null<Main::Session*> session,
Fn<void(FilterId)> choose,
Window::SessionController *controller = nullptr,
bool trackActiveFilterAndUnreadAndReorder = false);
} // namespace Ui