]> sigrok.org Git - pulseview.git/commitdiff
Trace view: Make the zero line for analog traces thicker
authorSoeren Apel <redacted>
Mon, 31 Jul 2017 22:09:06 +0000 (00:09 +0200)
committerUwe Hermann <redacted>
Tue, 1 Aug 2017 12:42:20 +0000 (14:42 +0200)
This is to make it stand out more and make it easily
distinguishable.

pv/views/trace/analogsignal.cpp
pv/views/trace/analogsignal.hpp
pv/views/trace/trace.cpp
pv/views/trace/trace.hpp

index c40c93b028a341d2e8c2329313d16acde193c925..323a2434ec79083f00db203a9c23ae37031ac790 100644 (file)
@@ -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<pv::data::Analog*>(data().get());
 
index 37b0c1a3ccdae7db9d89db07f2871abf8056473f..3b352f932e7a0c0808d18ff7f4cb48bf30d98f17 100644 (file)
@@ -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;
index 774351c6ea91c53b60f3e803c36cf71a7925b99b..f9bd87e1dd906bafdc23e135b818bc7c47f4b6b1 100644 (file)
@@ -50,6 +50,7 @@ const QColor Trace::DarkGrayBGColour = QColor(0, 0, 0, 15 * 255 / 100);
 
 Trace::Trace(shared_ptr<data::SignalBase> 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);
index 66a98055d66ac3cde5f34dac53fb7c7a1ad70952..407592de63bc7bb2221aadc77388424789533dfe 100644 (file)
@@ -144,6 +144,7 @@ private Q_SLOTS:
 
 protected:
        shared_ptr<data::SignalBase> base_;
+       QPen axis_pen_;
 
 private:
        pv::widgets::Popup *popup_;