const QPen Trace::AxisPen(QColor(128, 128, 128, 64));
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
+
Trace::Trace(QString name) :
name_(name),
+ coloured_bg_(true), // Default setting is set in MainWindow::setup_ui()
popup_(nullptr),
popup_form_(nullptr)
{
bgcolour_.setAlpha(20);
}
+void Trace::set_coloured_bg(bool state)
+{
+ coloured_bg_ = state;
+}
+
void Trace::paint_label(QPainter &p, const QRect &rect, bool hover)
{
const int y = get_visual_y();
label_size.height());
}
-QRectF Trace::hit_box_rect(const ViewItemPaintParams &pp) const
-{
- const float h = QFontMetrics(QApplication::font()).height();
- return QRectF(pp.left(), get_visual_y() - h / 2.0f,
- pp.width(), h);
-}
-
void Trace::paint_back(QPainter &p, const ViewItemPaintParams &pp)
{
+ if (coloured_bg_)
+ p.setBrush(bgcolour_);
+ else
+ p.setBrush(bgcolour_state_ ? BrightBGColour : DarkBGColour);
+
p.setPen(QPen(Qt::NoPen));
- p.setBrush(bgcolour_);
const std::pair<int, int> extents = v_extents();