MarginWidget: Moved in create_popup
[pulseview.git] / pv / view / marginwidget.cpp
index f3abe361feedae833531f7d54529f9e902c4a3bd..6b646832690974b21d77720e858141afc9b3677f 100644 (file)
 
 #include "marginwidget.hpp"
 
+#include <pv/widgets/popup.hpp>
+
+using std::shared_ptr;
+
 namespace pv {
 namespace view {
 
 MarginWidget::MarginWidget(View &parent) :
        QWidget(&parent),
-       view_(parent)
+       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()