Added ability to open menu from history view top bar with right click.

This commit is contained in:
23rd
2026-01-07 10:15:23 +03:00
parent b8a17d4266
commit 20b5de755d
@@ -75,6 +75,16 @@ 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<PeerData*> peer) {
return !peer->isUser()
&& !peer->groupCall()
@@ -125,7 +135,9 @@ TopBarWidget::TopBarWidget(
, _groupCall(this, st::topBarGroupCall)
, _search(this, st::topBarSearch)
, _infoToggle(this, st::topBarInfo)
, _menuToggle(this, st::topBarMenuToggle)
, _menuToggle(
object_ptr<Ui::IconButton>::fromRaw(
Ui::CreateChild<MenuToggleButton>(this, st::topBarMenuToggle)))
, _titlePeerText(st::windowMinWidth / 3)
, _onlineUpdater([=] { updateOnlineDisplay(); }) {
setAttribute(Qt::WA_OpaquePaintEvent);