X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Ftrace.cpp;h=66f13edb12dac9b4cf4795af5916c026f1713772;hb=857ebbef1c10cdc02df03af1fb446c704809394e;hp=985c295059a5da42c1390323de9396296712bfea;hpb=c063290ac7189bdd15221450f598504f43286b43;p=pulseview.git diff --git a/pv/view/trace.cpp b/pv/view/trace.cpp index 985c295..66f13ed 100644 --- a/pv/view/trace.cpp +++ b/pv/view/trace.cpp @@ -53,20 +53,12 @@ Trace::Trace(shared_ptr channel) : popup_(nullptr), popup_form_(nullptr) { - GlobalSettings settings; - coloured_bg_ = settings.value(GlobalSettings::Key_View_ColouredBG).toBool(); - connect(channel.get(), SIGNAL(name_changed(const QString&)), this, SLOT(on_name_changed(const QString&))); connect(channel.get(), SIGNAL(colour_changed(const QColor&)), this, SLOT(on_colour_changed(const QColor&))); } -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(); @@ -161,7 +153,10 @@ QRectF Trace::label_rect(const QRectF &rect) const void Trace::paint_back(QPainter &p, const ViewItemPaintParams &pp) { - if (coloured_bg_) + const View *view = owner_->view(); + assert(view); + + if (view->coloured_bg()) p.setBrush(base_->bgcolour()); else p.setBrush(bgcolour_state_ ? BrightGrayBGColour : DarkGrayBGColour); @@ -169,13 +164,8 @@ void Trace::paint_back(QPainter &p, const ViewItemPaintParams &pp) p.setPen(QPen(Qt::NoPen)); const 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; - - p.drawRect(x, y, w, h); + p.drawRect(pp.left(), get_visual_y() + extents.first, + pp.width(), extents.second - extents.first); } void Trace::paint_axis(QPainter &p, const ViewItemPaintParams &pp, int y)