From: Soeren Apel Date: Sat, 4 Jan 2020 19:05:12 +0000 (+0100) Subject: DecodeTrace: Add class color to selector checkboxes X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ec4f16ff84c688f2572c6e3d2e2184aee95f46f7;p=pulseview.git DecodeTrace: Add class color to selector checkboxes --- diff --git a/pv/views/trace/decodetrace.cpp b/pv/views/trace/decodetrace.cpp index 65b3172c..b1084f84 100644 --- a/pv/views/trace/decodetrace.cpp +++ b/pv/views/trace/decodetrace.cpp @@ -1246,6 +1246,11 @@ void DecodeTrace::initialize_row_widgets(DecodeTraceRow* r, unsigned int row_id) cb->setText(tr(ann_class->description)); cb->setChecked(ann_class->visible); + int dim = ViewItemPaintParams::text_height() - 2; + QPixmap pixmap(dim, dim); + pixmap.fill(r->ann_class_color[ann_class->id]); + cb->setIcon(pixmap); + r->selector_container->layout()->addWidget(cb); cb->setProperty("ann_class_ptr", QVariant::fromValue((void*)ann_class));