]> sigrok.org Git - pulseview.git/commitdiff
DecodeTrace: Add class color to selector checkboxes
authorSoeren Apel <redacted>
Sat, 4 Jan 2020 19:05:12 +0000 (20:05 +0100)
committerUwe Hermann <redacted>
Sun, 5 Jan 2020 21:46:36 +0000 (22:46 +0100)
pv/views/trace/decodetrace.cpp

index 65b3172cf36b4150910b8592c6d721e5080dd840..b1084f84e9c8228e427475577c32c0d956aee719 100644 (file)
@@ -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));