X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Ftrace.cpp;h=3727afa2de246912c8834dc0f3977d5131ec25bc;hp=05054d4927001c260d271d713ba88bbc14433029;hb=574c568d184240cd87be1b57fc00d60a4eac7566;hpb=99af6802961b0a5ec7ec7d3ff2215c8eb6925ca3 diff --git a/pv/view/trace.cpp b/pv/view/trace.cpp index 05054d49..3727afa2 100644 --- a/pv/view/trace.cpp +++ b/pv/view/trace.cpp @@ -43,6 +43,7 @@ const int Trace::LabelHitPadding = 2; Trace::Trace(QString name) : name_(name), + coloured_bg_(true), // Default setting is set in MainWindow::setup_ui() popup_(nullptr), popup_form_(nullptr) { @@ -71,6 +72,11 @@ void Trace::set_colour(QColor colour) bgcolour_.setAlpha(20); } +void Trace::set_coloured_bg(bool state) +{ + coloured_bg_ = state; +} + void Trace::paint_label(QPainter &p, const QRect &rect, bool hover) { const int y = get_visual_y(); @@ -175,17 +181,19 @@ QRectF Trace::hit_box_rect(const ViewItemPaintParams &pp) const void Trace::paint_back(QPainter &p, const ViewItemPaintParams &pp) { - p.setPen(QPen(Qt::NoPen)); - p.setBrush(bgcolour_); + if (coloured_bg_) { + p.setPen(QPen(Qt::NoPen)); + p.setBrush(bgcolour_); - const std::pair extents = v_extents(); + const std::pair extents = v_extents(); - const int x = 0; - const int y = get_visual_y() + extents.first; - const int w = pp.right() - pp.left(); - const int h = extents.second - extents.first; + const int x = 0; + const int y = get_visual_y() + extents.first; + const int w = pp.right() - pp.left(); + const int h = extents.second - extents.first; - p.drawRect(x, y, w, h); + p.drawRect(x, y, w, h); + } } void Trace::paint_axis(QPainter &p, const ViewItemPaintParams &pp, int y)