const QColor DecodeTrace::ErrorBgColor = QColor(0xEF, 0x29, 0x29);
const QColor DecodeTrace::NoDecodeColor = QColor(0x88, 0x8A, 0x85);
+const QColor DecodeTrace::ExpandMarkerWarnColor = QColor(0xFF, 0xA5, 0x00); // QColorConstants::Svg::orange
const uint8_t DecodeTrace::ExpansionAreaHeaderAlpha = 10 * 255 / 100;
const uint8_t DecodeTrace::ExpansionAreaAlpha = 5 * 255 / 100;
// If the row is hidden, we don't want to fetch annotations
assert(r.decode_row);
assert(r.decode_row->decoder());
- if ((!r.decode_row->decoder()->shown()) || (!r.decode_row->visible())) {
+ if ((!r.decode_row->decoder()->visible()) || (!r.decode_row->visible())) {
r.currently_visible = false;
continue;
}
decode_signal_->get_annotation_subset(annotations, r.decode_row,
current_segment_, sample_range.first, sample_range.second);
- // Show row if there are visible annotations or when user wants to see
+ // Show row if there are visible annotations, when user wants to see
// all rows that have annotations somewhere and this one is one of them
+ // or when the row has at least one hidden annotation class
r.currently_visible = !annotations.empty();
if (!r.currently_visible) {
size_t ann_count = decode_signal_->get_annotation_count(r.decode_row, current_segment_);
- r.currently_visible = always_show_all_rows_ && (ann_count > 0);
+ r.currently_visible = (always_show_all_rows_ || r.has_hidden_classes) &&
+ (ann_count > 0);
}
if (r.currently_visible) {
{
unsigned int y = get_visual_y();
+ update_expanded_rows();
+
for (const DecodeTraceRow& r : rows_) {
if (!r.currently_visible)
continue;
if (r.expand_marker_highlighted)
p.setBrush(QApplication::palette().brush(QPalette::Highlight));
+ else if (r.has_hidden_classes)
+ p.setBrush(ExpandMarkerWarnColor);
else
p.setBrush(QApplication::palette().brush(QPalette::WindowText));
if (hover_row) {
int row_y = get_row_y(hover_row);
- if ((hp.x() > 0) && (hp.x() < 2 * ArrowSize) &&
+ if ((hp.x() > 0) && (hp.x() < (int)(ArrowSize + 3 + hover_row->title_width)) &&
(hp.y() > (int)(row_y - ArrowSize)) && (hp.y() < (int)(row_y + ArrowSize)))
hover_row->expand_marker_highlighted = true;
}
continue;
unsigned int y = get_row_y(&r);
- if ((event->x() > 0) && (event->x() <= (int)(ArrowSize + 3)) &&
+ if ((event->x() > 0) && (event->x() <= (int)(ArrowSize + 3 + r.title_width)) &&
(event->y() > (int)(y - (default_row_height_ / 2))) &&
(event->y() <= (int)(y + (default_row_height_ / 2)))) {
tr("%1:\n%2").arg(QString::fromUtf8(decoder->longname),
QString::fromUtf8(decoder->desc)),
nullptr, decoder_deletable);
- group->set_decoder_visible(dec->shown());
+ group->set_decoder_visible(dec->visible());
if (decoder_deletable) {
delete_mapper_.setMapping(group, index);
r->selector_container->layout()->addWidget(cb);
cb->setProperty("ann_class_ptr", QVariant::fromValue((void*)ann_class));
+ cb->setProperty("decode_trace_row_ptr", QVariant::fromValue((void*)r));
+
class_show_hide_mapper_.setMapping(cb, cb);
connect(cb, SIGNAL(stateChanged(int)),
&class_show_hide_mapper_, SLOT(map()));
nr.height = default_row_height_;
nr.expanded_height = default_row_height_;
nr.currently_visible = false;
+ nr.has_hidden_classes = decode_row->has_hidden_classes();
nr.expand_marker_highlighted = false;
nr.expanding = false;
nr.expanded = false;
void DecodeTrace::update_expanded_rows()
{
for (DecodeTraceRow& r : rows_) {
-
r.container->move(2 * ArrowSize,
get_row_y(&r) + default_row_height_);
+
+ r.container->resize(owner_->view()->viewport()->width() - r.container->pos().x(),
+ r.height - 2 * default_row_height_);
}
}
{
void* ann_class_ptr = sender->property("ann_class_ptr").value<void*>();
assert(ann_class_ptr);
-
AnnotationClass* ann_class = (AnnotationClass*)ann_class_ptr;
+
ann_class->visible = !ann_class->visible;
+ void* row_ptr = sender->property("decode_trace_row_ptr").value<void*>();
+ assert(row_ptr);
+ DecodeTraceRow* row = (DecodeTraceRow*)row_ptr;
+
+ row->has_hidden_classes = row->decode_row->has_hidden_classes();
+
owner_->row_item_appearance_changed(false, true);
}