From: Soeren Apel Date: Mon, 31 Jul 2017 22:09:06 +0000 (+0200) Subject: Trace view: Make the zero line for analog traces thicker X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=561ba3ae052a93fe150a2161fcdc361144e68e4f;p=pulseview.git Trace view: Make the zero line for analog traces thicker This is to make it stand out more and make it easily distinguishable. --- diff --git a/pv/views/trace/analogsignal.cpp b/pv/views/trace/analogsignal.cpp index c40c93b0..323a2434 100644 --- a/pv/views/trace/analogsignal.cpp +++ b/pv/views/trace/analogsignal.cpp @@ -70,6 +70,7 @@ const QColor AnalogSignal::SignalColours[4] = { QColor(0x4E, 0x9A, 0x06) // Green }; +const QPen AnalogSignal::AxisPen(QColor(0, 0, 0, 30 * 256 / 100), 2); const QColor AnalogSignal::GridMajorColor = QColor(0, 0, 0, 40 * 256 / 100); const QColor AnalogSignal::GridMinorColor = QColor(0, 0, 0, 20 * 256 / 100); @@ -99,6 +100,8 @@ AnalogSignal::AnalogSignal( display_type_(DisplayBoth), autoranging_(true) { + axis_pen_ = AxisPen; + pv::data::Analog* analog_data = dynamic_cast(data().get()); diff --git a/pv/views/trace/analogsignal.hpp b/pv/views/trace/analogsignal.hpp index 37b0c1a3..3b352f93 100644 --- a/pv/views/trace/analogsignal.hpp +++ b/pv/views/trace/analogsignal.hpp @@ -47,6 +47,7 @@ class AnalogSignal : public Signal Q_OBJECT private: + static const QPen AxisPen; static const QColor SignalColours[4]; static const QColor GridMajorColor, GridMinorColor; static const QColor SamplingPointColour; diff --git a/pv/views/trace/trace.cpp b/pv/views/trace/trace.cpp index 774351c6..f9bd87e1 100644 --- a/pv/views/trace/trace.cpp +++ b/pv/views/trace/trace.cpp @@ -50,6 +50,7 @@ const QColor Trace::DarkGrayBGColour = QColor(0, 0, 0, 15 * 255 / 100); Trace::Trace(shared_ptr channel) : base_(channel), + axis_pen_(AxisPen), popup_(nullptr), popup_form_(nullptr) { @@ -180,7 +181,7 @@ void Trace::paint_axis(QPainter &p, ViewItemPaintParams &pp, int y) { p.setRenderHint(QPainter::Antialiasing, false); - p.setPen(AxisPen); + p.setPen(axis_pen_); p.drawLine(QPointF(pp.left(), y), QPointF(pp.right(), y)); p.setRenderHint(QPainter::Antialiasing, true); diff --git a/pv/views/trace/trace.hpp b/pv/views/trace/trace.hpp index 66a98055..407592de 100644 --- a/pv/views/trace/trace.hpp +++ b/pv/views/trace/trace.hpp @@ -144,6 +144,7 @@ private Q_SLOTS: protected: shared_ptr base_; + QPen axis_pen_; private: pv::widgets::Popup *popup_;