MarginWidget: Moved in create_popup
[pulseview.git] / pv / view / marginwidget.cpp
index e44233c80291c8a1cb1bdd2a5078ef9d505d6211..6b646832690974b21d77720e858141afc9b3677f 100644 (file)
 
 #include "marginwidget.hpp"
 
+#include <pv/widgets/popup.hpp>
+
+using std::shared_ptr;
+
 namespace pv {
 namespace view {
 
@@ -31,6 +35,15 @@ MarginWidget::MarginWidget(View &parent) :
        dragging_(false)
 {
        setAttribute(Qt::WA_NoSystemBackground, true);
+       setFocusPolicy(Qt::ClickFocus);
+       setMouseTracking(true);
+}
+
+void MarginWidget::show_popup(const shared_ptr<ViewItem> &item)
+{
+       pv::widgets::Popup *const p = item->create_popup(this);
+       if (p)
+               p->show();
 }
 
 void MarginWidget::clear_selection()