mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Close main menu on a web app opening.
This commit is contained in:
parent
976c696004
commit
e6a474d720
1 changed files with 5 additions and 1 deletions
|
@ -211,7 +211,7 @@ void SetupMenuBots(
|
|||
) | rpl::then(
|
||||
bots->attachBotsUpdates()
|
||||
) | rpl::start_with_next([=] {
|
||||
const auto width = wrap->widthNoMargins();
|
||||
const auto width = container->widthNoMargins();
|
||||
wrap->clear();
|
||||
for (const auto &bot : bots->attachBots()) {
|
||||
if (!bot.inMainMenu) {
|
||||
|
@ -234,6 +234,7 @@ void SetupMenuBots(
|
|||
(height - icon->height()) / 2);
|
||||
}, button->lifetime());
|
||||
const auto user = bot.user;
|
||||
const auto weak = Ui::MakeWeak(container);
|
||||
button->setAcceptBoth(true);
|
||||
button->clicks(
|
||||
) | rpl::start_with_next([=](Qt::MouseButton which) {
|
||||
|
@ -241,6 +242,9 @@ void SetupMenuBots(
|
|||
bots->requestSimple(controller, user, {
|
||||
.fromMainMenu = true,
|
||||
});
|
||||
if (weak) {
|
||||
controller->window().hideSettingsAndLayer();
|
||||
}
|
||||
} else {
|
||||
(*menu) = nullptr;
|
||||
(*menu) = base::make_unique_q<Ui::PopupMenu>(
|
||||
|
|
Loading…
Add table
Reference in a new issue