X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Fview.cpp;h=7d3dc7f628a73b9bd5e4be03d6c8a6e45e33dfb2;hb=f76af6375b8aea6b7edb2d6ee838e1589c3490f3;hp=54871b5ebc3d4c211898f5961fc9eb3978571782;hpb=e2f5223b74da179688de92146a2716209b42bdb0;p=pulseview.git diff --git a/pv/view/view.cpp b/pv/view/view.cpp index 54871b5..7d3dc7f 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -53,6 +53,8 @@ const int View::MaxScrollValue = INT_MAX / 2; const int View::SignalHeight = 50; +const QColor View::CursorAreaColour(220, 231, 243); + View::View(SigSession &session, QWidget *parent) : QAbstractScrollArea(parent), _session(session), @@ -63,6 +65,9 @@ View::View(SigSession &session, QWidget *parent) : _scale(1e-6), _offset(0), _v_offset(0), + _show_cursors(false), + _cursors(pair(Cursor(*this, 0.0), + Cursor(*this, 1.0))), _hover_point(-1, -1) { connect(horizontalScrollBar(), SIGNAL(valueChanged(int)), @@ -128,6 +133,23 @@ void View::set_scale_offset(double scale, double offset) _viewport->update(); } +bool View::cursors_shown() const +{ + return _show_cursors; +} + +void View::show_cursors(bool show) +{ + _show_cursors = show; + _ruler->update(); + _viewport->update(); +} + +std::pair& View::cursors() +{ + return _cursors; +} + const QPoint& View::hover_point() const { return _hover_point;