void MarginWidget::contextMenuEvent(QContextMenuEvent *event)
{
+ event->setAccepted(false);
+
const shared_ptr<ViewItem> r = get_mouse_over_item(mouse_point_);
if (!r)
return;
QMenu *menu = r->create_header_context_menu(this);
- if (menu)
+ if (menu) {
+ event->setAccepted(true);
menu->popup(event->globalPos());
+ }
}
void MarginWidget::keyPressEvent(QKeyEvent *event)
void Ruler::contextMenuEvent(QContextMenuEvent *event)
{
+ MarginWidget::contextMenuEvent(event);
+
+ // Don't show a context menu if the MarginWidget found a widget that shows one
+ if (event->isAccepted())
+ return;
+
context_menu_x_pos_ = event->pos().x();
QMenu *const menu = new QMenu(this);
toggle_hover_marker->setText(hover_marker_shown ?
tr("Disable mouse hover marker") : tr("Enable mouse hover marker"));
+ event->setAccepted(true);
menu->popup(event->globalPos());
}