mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
Fixed display of chats filters strip in new windows.
This commit is contained in:
parent
715874a98f
commit
9d3b3476c2
3 changed files with 12 additions and 3 deletions
|
@ -1331,6 +1331,7 @@ void Widget::toggleFiltersMenu(bool enabled) {
|
|||
controller()->setActiveChatsFilter(id);
|
||||
}
|
||||
},
|
||||
controller(),
|
||||
true);
|
||||
raw->show();
|
||||
raw->stackUnder(_scroll);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue