X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fmarginwidget.cpp;h=537ffe5ef298ad29b1cc6dd00a9ab5bab1992fd5;hb=20c99cfc69d3c7430817abd9a1f810698deb4a18;hp=c2d443651f2c740369ff0d3678d096b049ee5eaf;hpb=710c2a1896fbac968c82f2d1257aaabd10a48cc8;p=pulseview.git diff --git a/pv/views/trace/marginwidget.cpp b/pv/views/trace/marginwidget.cpp index c2d44365..537ffe5e 100644 --- a/pv/views/trace/marginwidget.cpp +++ b/pv/views/trace/marginwidget.cpp @@ -47,6 +47,9 @@ 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); + + connect(p, SIGNAL(closed()), this, SLOT(on_popup_closed())); + if (p) p->show(); } @@ -80,6 +83,17 @@ void MarginWidget::keyPressEvent(QKeyEvent *event) 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