mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 23:24:01 +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()->setActiveChatsFilter(id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
controller(),
|
||||||
true);
|
true);
|
||||||
raw->show();
|
raw->show();
|
||||||
raw->stackUnder(_scroll);
|
raw->stackUnder(_scroll);
|
||||||
|
|
|
@ -173,16 +173,19 @@ not_null<Ui::RpWidget*> AddChatFiltersTabsStrip(
|
||||||
not_null<Ui::RpWidget*> parent,
|
not_null<Ui::RpWidget*> parent,
|
||||||
not_null<Main::Session*> session,
|
not_null<Main::Session*> session,
|
||||||
Fn<void(FilterId)> choose,
|
Fn<void(FilterId)> choose,
|
||||||
|
Window::SessionController *controller,
|
||||||
bool trackActiveFilterAndUnreadAndReorder) {
|
bool trackActiveFilterAndUnreadAndReorder) {
|
||||||
const auto window = Core::App().findWindow(parent);
|
|
||||||
const auto controller = window ? window->sessionController() : nullptr;
|
|
||||||
|
|
||||||
const auto &scrollSt = st::defaultScrollArea;
|
const auto &scrollSt = st::defaultScrollArea;
|
||||||
const auto wrap = Ui::CreateChild<Ui::SlideWrap<Ui::RpWidget>>(
|
const auto wrap = Ui::CreateChild<Ui::SlideWrap<Ui::RpWidget>>(
|
||||||
parent,
|
parent,
|
||||||
object_ptr<Ui::RpWidget>(parent));
|
object_ptr<Ui::RpWidget>(parent));
|
||||||
if (!controller) {
|
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 container = wrap->entity();
|
||||||
const auto scroll = Ui::CreateChild<Ui::ScrollArea>(container, scrollSt);
|
const auto scroll = Ui::CreateChild<Ui::ScrollArea>(container, scrollSt);
|
||||||
|
|
|
@ -15,12 +15,17 @@ namespace Ui {
|
||||||
class RpWidget;
|
class RpWidget;
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
||||||
|
namespace Window {
|
||||||
|
class SessionController;
|
||||||
|
} // namespace Window
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
||||||
not_null<Ui::RpWidget*> AddChatFiltersTabsStrip(
|
not_null<Ui::RpWidget*> AddChatFiltersTabsStrip(
|
||||||
not_null<Ui::RpWidget*> parent,
|
not_null<Ui::RpWidget*> parent,
|
||||||
not_null<Main::Session*> session,
|
not_null<Main::Session*> session,
|
||||||
Fn<void(FilterId)> choose,
|
Fn<void(FilterId)> choose,
|
||||||
|
Window::SessionController *controller = nullptr,
|
||||||
bool trackActiveFilterAndUnreadAndReorder = false);
|
bool trackActiveFilterAndUnreadAndReorder = false);
|
||||||
|
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
Loading…
Add table
Reference in a new issue