2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Fixed filling context menu in TabbedPanel between sections.

Fixed #10082.
This commit is contained in:
23rd
2021-01-08 01:38:09 +03:00
parent 8ae1b10b91
commit a030911ad5
4 changed files with 26 additions and 21 deletions

View File

@@ -877,11 +877,8 @@ void TabbedSelector::scrollToY(int y) {
}
}
void TabbedSelector::contextMenuEvent(QContextMenuEvent *e) {
void TabbedSelector::showMenuWithType(SendMenu::Type type) {
_menu = base::make_unique_q<Ui::PopupMenu>(this);
const auto type = _sendMenuType
? _sendMenuType()
: SendMenu::Type::Disabled;
currentTab()->widget()->fillContextMenu(_menu, type);
if (!_menu->actions().empty()) {
@@ -889,6 +886,13 @@ void TabbedSelector::contextMenuEvent(QContextMenuEvent *e) {
}
}
rpl::producer<> TabbedSelector::contextMenuRequested() const {
return events(
) | rpl::filter([=](not_null<QEvent*> e) {
return e->type() == QEvent::ContextMenu;
}) | rpl::to_empty;
}
TabbedSelector::Inner::Inner(
QWidget *parent,
not_null<Window::SessionController*> controller)