summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bc4b9cc)
Without this change, PD row colors depend on the visible rows,
not a constant ID. This means that rows that collapse change the
colors of all rows coming after them.
-Row::Row(const srd_decoder *decoder, const srd_decoder_annotation_row *row) :
+Row::Row(int index, const srd_decoder *decoder, const srd_decoder_annotation_row *row) :
+ index_(index),
decoder_(decoder),
row_(row)
{
decoder_(decoder),
row_(row)
{
+int Row::index() const
+{
+ return index_;
+}
+
bool Row::operator<(const Row &other) const
{
return (decoder_ < other.decoder_) ||
bool Row::operator<(const Row &other) const
{
return (decoder_ < other.decoder_) ||
- Row(const srd_decoder *decoder,
+ Row(int index, const srd_decoder *decoder,
const srd_decoder_annotation_row *row = nullptr);
const srd_decoder* decoder() const;
const srd_decoder_annotation_row* row() const;
const QString title() const;
const srd_decoder_annotation_row *row = nullptr);
const srd_decoder* decoder() const;
const srd_decoder_annotation_row* row() const;
const QString title() const;
bool operator<(const Row &other) const;
private:
bool operator<(const Row &other) const;
private:
const srd_decoder *decoder_;
const srd_decoder_annotation_row *row_;
};
const srd_decoder *decoder_;
const srd_decoder_annotation_row *row_;
};
}
// Map out all the annotation classes
}
// Map out all the annotation classes
for (const shared_ptr<decode::Decoder> &dec : stack_) {
assert(dec);
const srd_decoder *const decc = dec->decoder();
for (const shared_ptr<decode::Decoder> &dec : stack_) {
assert(dec);
const srd_decoder *const decc = dec->decoder();
(srd_decoder_annotation_row *)l->data;
assert(ann_row);
(srd_decoder_annotation_row *)l->data;
assert(ann_row);
- const Row row(decc, ann_row);
+ const Row row(row_index++, decc, ann_row);
for (const GSList *ll = ann_row->ann_classes;
ll; ll = ll->next)
for (const GSList *ll = ann_row->ann_classes;
ll; ll = ll->next)
const srd_decoder *const decc = dec->decoder();
assert(dec->decoder());
const srd_decoder *const decc = dec->decoder();
assert(dec->decoder());
// Add a row for the decoder if it doesn't have a row list
if (!decc->annotation_rows)
// Add a row for the decoder if it doesn't have a row list
if (!decc->annotation_rows)
- rows.emplace_back(decc);
+ rows.emplace_back(row_index++, decc);
// Add the decoder rows
for (const GSList *l = decc->annotation_rows; l; l = l->next) {
const srd_decoder_annotation_row *const ann_row =
(srd_decoder_annotation_row *)l->data;
assert(ann_row);
// Add the decoder rows
for (const GSList *l = decc->annotation_rows; l; l = l->next) {
const srd_decoder_annotation_row *const ann_row =
(srd_decoder_annotation_row *)l->data;
assert(ann_row);
- rows.emplace_back(decc, ann_row);
+ rows.emplace_back(row_index++, decc, ann_row);
const srd_decoder *const decc = dec->decoder();
assert(dec->decoder());
const srd_decoder *const decc = dec->decoder();
assert(dec->decoder());
// Add a row for the decoder if it doesn't have a row list
if (!decc->annotation_rows)
// Add a row for the decoder if it doesn't have a row list
if (!decc->annotation_rows)
- (segments_.back().annotation_rows)[Row(decc)] =
+ (segments_.back().annotation_rows)[Row(row_index++, decc)] =
decode::RowData();
// Add the decoder rows
decode::RowData();
// Add the decoder rows
(srd_decoder_annotation_row *)l->data;
assert(ann_row);
(srd_decoder_annotation_row *)l->data;
assert(ann_row);
- const Row row(decc, ann_row);
+ const Row row(row_index++, decc, ann_row);
// Add a new empty row data object
(segments_.back().annotation_rows)[row] =
// Add a new empty row data object
(segments_.back().annotation_rows)[row] =
row_iter = ds->segments_.at(ds->current_segment_id_).annotation_rows.find((*r).second);
else {
// Failing that, use the decoder as a key
row_iter = ds->segments_.at(ds->current_segment_id_).annotation_rows.find((*r).second);
else {
// Failing that, use the decoder as a key
- row_iter = ds->segments_.at(ds->current_segment_id_).annotation_rows.find(Row(decc));
+ row_iter = ds->segments_.at(ds->current_segment_id_).annotation_rows.find(Row(0, decc));
}
if (row_iter == ds->segments_.at(ds->current_segment_id_).annotation_rows.end()) {
}
if (row_iter == ds->segments_.at(ds->current_segment_id_).annotation_rows.end()) {
current_segment_, sample_range.first, sample_range.second);
if (!annotations.empty()) {
draw_annotations(annotations, p, annotation_height, pp, y,
current_segment_, sample_range.first, sample_range.second);
if (!annotations.empty()) {
draw_annotations(annotations, p, annotation_height, pp, y,
- get_row_color(visible_rows_.size()), row_title_width);
-
+ get_row_color(row.index()), row_title_width);
y += row_height_;
visible_rows_.push_back(row);
}
y += row_height_;
visible_rows_.push_back(row);
}