mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Don't show empty context menu.
This commit is contained in:
parent
8d4a658d0b
commit
c313cfb4ec
1 changed files with 10 additions and 6 deletions
|
@ -4454,12 +4454,16 @@ bool OverlayWidget::handleContextMenu(std::optional<QPoint> position) {
|
|||
const style::icon *icon) {
|
||||
_menu->addAction(text, std::move(handler), icon);
|
||||
});
|
||||
_menu->setDestroyedCallback(crl::guard(_widget, [=] {
|
||||
activateControls();
|
||||
_receiveMouse = false;
|
||||
InvokeQueued(_widget, [=] { receiveMouse(); });
|
||||
}));
|
||||
_menu->popup(QCursor::pos());
|
||||
if (_menu->empty()) {
|
||||
_menu = nullptr;
|
||||
} else {
|
||||
_menu->setDestroyedCallback(crl::guard(_widget, [=] {
|
||||
activateControls();
|
||||
_receiveMouse = false;
|
||||
InvokeQueued(_widget, [=] { receiveMouse(); });
|
||||
}));
|
||||
_menu->popup(QCursor::pos());
|
||||
}
|
||||
activateControls();
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue