]> sigrok.org Git - pulseview.git/blobdiff - pv/views/trace/marginwidget.cpp
DecodeTrace: Allow row hiding
[pulseview.git] / pv / views / trace / marginwidget.cpp
index 86ec069bc2370147b76b9cb16bfc606655f2cabf..537ffe5ef298ad29b1cc6dd00a9ab5bab1992fd5 100644 (file)
@@ -47,6 +47,9 @@ void MarginWidget::item_clicked(const shared_ptr<ViewItem> &item)
 void MarginWidget::show_popup(const shared_ptr<ViewItem> &item)
 {
        pv::widgets::Popup *const p = item->create_popup(this);
+
+       connect(p, SIGNAL(closed()), this, SLOT(on_popup_closed()));
+
        if (p)
                p->show();
 }
@@ -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