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

Separate form controller from view controller.

This commit is contained in:
John Preston
2018-03-29 23:49:31 +04:00
parent b0a9d26a94
commit a2dabfde56
19 changed files with 668 additions and 302 deletions

View File

@@ -41,11 +41,13 @@ void ShowSearchFromBox(
return nullptr;
};
if (auto controller = createController()) {
auto subscription = std::make_shared<base::Subscription>();
auto subscription = std::make_shared<rpl::lifetime>();
auto box = Ui::show(Box<PeerListBox>(std::move(controller), [subscription](not_null<PeerListBox*> box) {
box->addButton(langFactory(lng_cancel), [box, subscription] { box->closeBox(); });
}), LayerOption::KeepOther);
*subscription = box->boxClosing.add_subscription(std::move(closedCallback));
box->boxClosing() | rpl::start_with_next(
std::move(closedCallback),
*subscription);
}
}