mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-28 08:22:31 +00:00
Added ability to open menu from history view top bar with right click.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user