From 68f65ea0004c3437366175e29c21333826f96a9b Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Wed, 21 Jan 2026 21:25:50 +0300 Subject: [PATCH] Slightly improved position of context menu from top button in proxy box. --- Telegram/SourceFiles/boxes/connection_box.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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; }); }