X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Fheader.cpp;h=ba16247a8c8e5609245bc8233943295ff068b32b;hb=91e8bf08c9799cb1041d26bf2ff6b67abf9a420b;hp=549b71918627b4bd1a6d0e01f2e20f6fe17994f6;hpb=728fcafc9897d3ffb4a109b6248d88b0945128f5;p=pulseview.git diff --git a/pv/view/header.cpp b/pv/view/header.cpp index 549b719..ba16247 100644 --- a/pv/view/header.cpp +++ b/pv/view/header.cpp @@ -34,6 +34,8 @@ #include #include +#include + using namespace boost; using namespace std; @@ -151,11 +153,28 @@ void Header::mousePressEvent(QMouseEvent *event) void Header::mouseReleaseEvent(QMouseEvent *event) { + using pv::widgets::Popup; + assert(event); if (event->button() == Qt::LeftButton) { + if (_dragging) + _view.normalize_layout(); + else + { + const shared_ptr mouse_over_trace = + get_mouse_over_trace(event->pos()); + if (mouse_over_trace) { + Popup *const p = + mouse_over_trace->create_popup(&_view); + p->set_position(mapToGlobal(QPoint(width(), + mouse_over_trace->get_y())), + Popup::Right); + p->show(); + } + } + _dragging = false; _drag_traces.clear(); - _view.normalize_layout(); } } @@ -221,7 +240,10 @@ void Header::on_signals_changed() const vector< shared_ptr > traces(_view.get_traces()); BOOST_FOREACH(shared_ptr t, traces) { assert(t); - connect(t.get(), SIGNAL(text_changed()), this, SLOT(update())); + connect(t.get(), SIGNAL(text_changed()), + this, SLOT(update())); + connect(t.get(), SIGNAL(colour_changed()), + this, SLOT(update())); } }