X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Ftrace.hpp;h=cb5ac15c6ec2173f14cc3d7dbde1ac298a7a333e;hp=677f366b477f7b1caaaae3bfb03a523ff3a51a0d;hb=bc72e51ffa24d47a382b118bfe63df154dac9cf1;hpb=cbf0f87e496c9d9157591c94dc445aaa960fe79d diff --git a/pv/view/trace.hpp b/pv/view/trace.hpp index 677f366b..cb5ac15c 100644 --- a/pv/view/trace.hpp +++ b/pv/view/trace.hpp @@ -49,6 +49,9 @@ private: static const QPen AxisPen; static const int LabelHitPadding; + static const QColor BrightBGColour; + static const QColor DarkBGColour; + protected: Trace(QString name); @@ -74,11 +77,9 @@ public: void set_colour(QColor colour); /** - * Computes the outline rectangle of the viewport hit-box. - * @param rect the rectangle of the viewport area. - * @return Returns the rectangle of the hit-box. + * Enables or disables the coloured background for this trace. */ - QRectF hit_box_rect(const ViewItemPaintParams &pp) const; + void set_coloured_bg(bool state); /** * Paints the signal label. @@ -100,6 +101,13 @@ public: QRectF label_rect(const QRectF &rect) const; protected: + /** + * Paints the background layer of the signal with a QPainter. + * @param p The QPainter to paint into. + * @param pp The painting parameters object to paint with. + */ + virtual void paint_back(QPainter &p, const ViewItemPaintParams &pp); + /** * Paints a zero axis across the viewport. * @param p the QPainter to paint into. @@ -123,7 +131,8 @@ private Q_SLOTS: protected: QString name_; - QColor colour_; + QColor colour_, bgcolour_; + bool coloured_bg_, coloured_bg_state_; private: pv::widgets::Popup *popup_;