2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Added ability to pass SendMenuType to TabbedSelector.

This commit is contained in:
23rd
2020-07-25 19:50:19 +03:00
committed by John Preston
parent 7db9843543
commit 43056107fd
7 changed files with 36 additions and 10 deletions

View File

@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "chat_helpers/tabbed_selector.h"
#include "chat_helpers/message_field.h"
#include "chat_helpers/emoji_list_widget.h"
#include "chat_helpers/stickers_list_widget.h"
#include "chat_helpers/gifs_list_widget.h"
@@ -876,7 +877,10 @@ void TabbedSelector::scrollToY(int y) {
void TabbedSelector::contextMenuEvent(QContextMenuEvent *e) {
_menu = base::make_unique_q<Ui::PopupMenu>(this);
currentTab()->widget()->fillContextMenu(_menu);
const auto type = _sendMenuType
? _sendMenuType()
: SendMenuType::Disabled;
currentTab()->widget()->fillContextMenu(_menu, type);
if (!_menu->actions().empty()) {
_menu->popup(QCursor::pos());