X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fmarginwidget.cpp;h=347b41edfe7bcfb6afef775b58aa96568762fdb1;hb=67784be7a0b4ab46ed566119d182d92695a40ae3;hp=86ec069bc2370147b76b9cb16bfc606655f2cabf;hpb=dde5aab3c1c55ef4bf7b255b976b23320bad384f;p=pulseview.git diff --git a/pv/views/trace/marginwidget.cpp b/pv/views/trace/marginwidget.cpp index 86ec069b..347b41ed 100644 --- a/pv/views/trace/marginwidget.cpp +++ b/pv/views/trace/marginwidget.cpp @@ -47,8 +47,11 @@ void MarginWidget::item_clicked(const shared_ptr &item) void MarginWidget::show_popup(const shared_ptr &item) { pv::widgets::Popup *const p = item->create_popup(this); - if (p) + + if (p) { + connect(p, SIGNAL(closed()), this, SLOT(on_popup_closed())); p->show(); + } } void MarginWidget::contextMenuEvent(QContextMenuEvent *event) @@ -76,8 +79,21 @@ void MarginWidget::keyPressEvent(QKeyEvent *event) if (i->selected()) i->delete_pressed(); } + + ViewWidget::keyPressEvent(event); } +void MarginWidget::on_popup_closed() +{ + bool cursor_above_widget = rect().contains(mapFromGlobal(QCursor::pos())); + + if (!cursor_above_widget) + mouse_point_ = QPoint(INT_MIN, INT_MIN); + + update(); +} + + } // namespace trace } // namespace views } // namespace pv