2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 23:15:59 +00:00

Improve peer context menu for info.

This commit is contained in:
John Preston
2017-11-06 22:03:20 +04:00
parent 3fe12f1249
commit 8191ebfc49
9 changed files with 424 additions and 152 deletions

View File

@@ -38,6 +38,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "auth_session.h"
#include "window/notifications_manager.h"
#include "window/window_controller.h"
#include "window/window_peer_menu.h"
#include "ui/widgets/multi_select.h"
namespace {
@@ -1240,9 +1241,14 @@ void DialogsInner::contextMenuEvent(QContextMenuEvent *e) {
}
_menu = new Ui::PopupMenu(nullptr);
App::main()->fillPeerMenu(_menuPeer, [this](const QString &text, base::lambda<void()> callback) {
return _menu->addAction(text, std::move(callback));
}, true);
Window::PeerMenuOptions options;
options.pinToggle = options.showInfo = options.search = true;
Window::FillPeerMenu(
_menuPeer,
[this](const QString &text, base::lambda<void()> callback) {
return _menu->addAction(text, std::move(callback));
},
options);
connect(_menu, SIGNAL(destroyed(QObject*)), this, SLOT(onMenuDestroyed(QObject*)));
_menu->popup(e->globalPos());
e->accept();