From: Soeren Apel Date: Mon, 18 Apr 2016 06:25:36 +0000 (+0200) Subject: Fix #771 by using black with alpha instead of an opaque grey X-Git-Tag: pulseview-0.4.0~303 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d55923a65aa672f65f9fe2c30ddbe46beddcaa3a;p=pulseview.git Fix #771 by using black with alpha instead of an opaque grey --- diff --git a/pv/view/trace.cpp b/pv/view/trace.cpp index fd6107f6..ea443f23 100644 --- a/pv/view/trace.cpp +++ b/pv/view/trace.cpp @@ -41,8 +41,9 @@ namespace view { const QPen Trace::AxisPen(QColor(0, 0, 0, 30*256/100)); const int Trace::LabelHitPadding = 2; -const QColor Trace::DarkBGColour(235, 235, 235); // Quite light grey -const QColor Trace::BrightBGColour(245, 245, 245); // Very light grey +const int Trace::ColourBGAlpha = 8*256/100; +const QColor Trace::BrightGrayBGColour = QColor(0, 0, 0, 10*255/100); +const QColor Trace::DarkGrayBGColour = QColor(0, 0, 0, 15*255/100); Trace::Trace(QString name) : name_(name), @@ -72,7 +73,7 @@ void Trace::set_colour(QColor colour) colour_ = colour; bgcolour_ = colour; - bgcolour_.setAlpha(20); + bgcolour_.setAlpha(ColourBGAlpha); } void Trace::set_coloured_bg(bool state) @@ -180,7 +181,7 @@ void Trace::paint_back(QPainter &p, const ViewItemPaintParams &pp) if (coloured_bg_) p.setBrush(bgcolour_); else - p.setBrush(bgcolour_state_ ? BrightBGColour : DarkBGColour); + p.setBrush(bgcolour_state_ ? BrightGrayBGColour : DarkGrayBGColour); p.setPen(QPen(Qt::NoPen)); diff --git a/pv/view/trace.hpp b/pv/view/trace.hpp index cb5ac15c..4e95f565 100644 --- a/pv/view/trace.hpp +++ b/pv/view/trace.hpp @@ -49,8 +49,9 @@ private: static const QPen AxisPen; static const int LabelHitPadding; - static const QColor BrightBGColour; - static const QColor DarkBGColour; + static const int ColourBGAlpha; + static const QColor BrightGrayBGColour; + static const QColor DarkGrayBGColour; protected: Trace(QString name);