2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 06:55:58 +00:00

Pass SessionNavigation to some boxes.

This commit is contained in:
John Preston
2019-07-25 20:55:11 +02:00
parent 137fa0378c
commit bacaf805b5
54 changed files with 601 additions and 233 deletions

View File

@@ -235,21 +235,22 @@ MainMenu::MainMenu(
void MainMenu::refreshMenu() {
_menu->clearActions();
if (!_controller->session().supportMode()) {
const auto controller = _controller;
_menu->addAction(tr::lng_create_group_title(tr::now), [] {
App::wnd()->onShowNewGroup();
}, &st::mainMenuNewGroup, &st::mainMenuNewGroupOver);
_menu->addAction(tr::lng_create_channel_title(tr::now), [] {
App::wnd()->onShowNewChannel();
}, &st::mainMenuNewChannel, &st::mainMenuNewChannelOver);
_menu->addAction(tr::lng_menu_contacts(tr::now), [] {
Ui::show(Box<PeerListBox>(std::make_unique<ContactsBoxController>(), [](not_null<PeerListBox*> box) {
_menu->addAction(tr::lng_menu_contacts(tr::now), [=] {
Ui::show(Box<PeerListBox>(std::make_unique<ContactsBoxController>(controller), [](not_null<PeerListBox*> box) {
box->addButton(tr::lng_close(), [box] { box->closeBox(); });
box->addLeftButton(tr::lng_profile_add_contact(), [] { App::wnd()->onShowAddContact(); });
}));
}, &st::mainMenuContacts, &st::mainMenuContactsOver);
if (Global::PhoneCallsEnabled()) {
_menu->addAction(tr::lng_menu_calls(tr::now), [] {
Ui::show(Box<PeerListBox>(std::make_unique<Calls::BoxController>(), [](not_null<PeerListBox*> box) {
_menu->addAction(tr::lng_menu_calls(tr::now), [=] {
Ui::show(Box<PeerListBox>(std::make_unique<Calls::BoxController>(controller), [](not_null<PeerListBox*> box) {
box->addButton(tr::lng_close(), [=] {
box->closeBox();
});