From: Soeren Apel Date: Sun, 28 Oct 2018 19:27:07 +0000 (+0100) Subject: SignalBase: Make sure an invalid color isn't shown as "white" X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=e590fc9c4f01fe3a4147c63e85f7aeaffeec5498;p=pulseview.git SignalBase: Make sure an invalid color isn't shown as "white" While the color technically is black and not white, an alpha value of 0 makes it appear as white. --- diff --git a/pv/data/signalbase.cpp b/pv/data/signalbase.cpp index 670de498..78633de9 100644 --- a/pv/data/signalbase.cpp +++ b/pv/data/signalbase.cpp @@ -474,10 +474,14 @@ void SignalBase::restore_settings(QSettings &settings) QVariant value = settings.value("color"); // Workaround for Qt QColor serialization bug on OSX - if (((QMetaType::Type)(value.type()) == QMetaType::QColor) && value.isValid()) + if ((QMetaType::Type)(value.type()) == QMetaType::QColor) set_color(value.value()); else set_color(QColor::fromRgba(value.value())); + + // A color with an alpha value of 0 makes the signal marker invisible + if (color() == QColor(0, 0, 0, 0)) + set_color(Qt::gray); } if (settings.contains("conversion_type"))