From 9a0422012940c87119b41bbb5e13fe234bbd40bc Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 30 Jan 2026 13:48:29 +0300 Subject: [PATCH] Added ability to open call menu from history top bar with right click. Related commit: 20b5de755d. --- .../view/history_view_top_bar_widget.cpp | 19 ++++--------------- Telegram/lib_ui | 2 +- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp index 6eb1651d64..b401694343 100644 --- a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp @@ -76,16 +76,6 @@ namespace { constexpr auto kEmojiInteractionSeenDuration = 3 * crl::time(1000); -class MenuToggleButton final : public Ui::IconButton { -public: - using IconButton::IconButton; - -protected: - void contextMenuEvent(QContextMenuEvent *e) override { - Ui::AbstractButton::clicked(Qt::KeyboardModifiers(), Qt::LeftButton); - } -}; - [[nodiscard]] inline bool HasGroupCallMenu(not_null peer) { return !peer->isUser() && !peer->groupCall() @@ -136,9 +126,7 @@ TopBarWidget::TopBarWidget( , _groupCall(this, st::topBarGroupCall) , _search(this, st::topBarSearch) , _infoToggle(this, st::topBarInfo) -, _menuToggle( - object_ptr::fromRaw( - Ui::CreateChild(this, st::topBarMenuToggle))) +, _menuToggle(this, st::topBarMenuToggle) , _titlePeerText(st::windowMinWidth / 3) , _onlineUpdater([=] { updateOnlineDisplay(); }) { setAttribute(Qt::WA_OpaquePaintEvent); @@ -156,14 +144,15 @@ TopBarWidget::TopBarWidget( _delete->setWidthChangedCallback([=] { updateControlsGeometry(); }); _clear->setClickedCallback([=] { _clearSelection.fire({}); }); _call->setClickedCallback([=] { call({}); }); - _call->setAcceptBoth(); + _call->setAcceptBoth(true, true); _call->addClickHandler([=](Qt::MouseButton button) { if (button == Qt::RightButton) { showCallMenu(); } }); _groupCall->setClickedCallback([=] { groupCall(); }); - _menuToggle->setClickedCallback([=] { showPeerMenu(); }); + _menuToggle->addClickHandler([=](auto) { showPeerMenu(); }); + _menuToggle->setAcceptBoth(true, true); _infoToggle->setClickedCallback([=] { toggleInfoSection(); }); _back->setAcceptBoth(); _back->addClickHandler([=](Qt::MouseButton) { diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 804feb7eb0..6a02d5f970 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 804feb7eb0bf8b7d62bb52fa9516b951c33785fc +Subproject commit 6a02d5f97083bcae72af0a4665bd5ab4c98cd6e0