Don't show empty popup menu in ListWidget.

This commit is contained in:
John Preston 2022-11-03 14:27:42 +04:00
parent 1953cc2f8a
commit 67d99355ca
1 changed files with 5 additions and 0 deletions

View File

@ -2527,6 +2527,10 @@ void ListWidget::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
_overState));
_menu = FillContextMenu(this, request);
if (_menu->empty()) {
_menu = nullptr;
return;
}
using namespace HistoryView::Reactions;
const auto desiredPosition = e->globalPos();
@ -3259,6 +3263,7 @@ void ListWidget::mouseActionUpdate() {
view ? view->height() : 0,
itemPoint,
view ? view->pointState(itemPoint) : PointState::Outside);
_overItemExact = nullptr;
const auto viewChanged = (_overElement != view);
if (viewChanged) {
repaintItem(_overElement);