diff --git a/Telegram/SourceFiles/boxes/connection_box.cpp b/Telegram/SourceFiles/boxes/connection_box.cpp index c26d572b48..1198f1e501 100644 --- a/Telegram/SourceFiles/boxes/connection_box.cpp +++ b/Telegram/SourceFiles/boxes/connection_box.cpp @@ -790,7 +790,8 @@ void ProxiesBox::setupTopButton() { *menu = base::make_unique_q( top, st::popupMenuWithIcons); - const auto addAction = Ui::Menu::CreateAddActionCallback(*menu); + const auto raw = menu->get(); + const auto addAction = Ui::Menu::CreateAddActionCallback(raw); addAction({ .text = tr::lng_proxy_add_from_clipboard(tr::now), .handler = [=] { AddProxyFromClipboard(_controller, uiShow()); }, @@ -804,7 +805,16 @@ void ProxiesBox::setupTopButton() { .isAttention = true, }); } - (*menu)->popup(QCursor::pos()); + raw->setForcedOrigin(Ui::PanelAnimation::Origin::TopRight); + top->setForceRippled(true); + raw->setDestroyedCallback([=] { + if (const auto strong = top.data()) { + strong->setForceRippled(false); + } + }); + raw->popup( + top->mapToGlobal( + QPoint(top->width(), top->height() - st::lineWidth * 3))); return true; }); }