X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fdecodetrace.cpp;h=b4857336f9e6e1e350bc73e91ef6409bcc3f7e2e;hb=ded43869b4d6169b7f269af0623ef0a682e5b910;hp=e6b977ae01952ea1d22f377e8898b060c6fc3c1c;hpb=53b652bdde928b42a116e60f5c07800d0bd0b873;p=pulseview.git diff --git a/pv/views/trace/decodetrace.cpp b/pv/views/trace/decodetrace.cpp index e6b977a..b485733 100644 --- a/pv/views/trace/decodetrace.cpp +++ b/pv/views/trace/decodetrace.cpp @@ -248,11 +248,13 @@ void DecodeTrace::paint_mid(QPainter &p, ViewItemPaintParams &pp) // Draw the hatching draw_unresolved_period(p, annotation_height, pp.left(), pp.right()); - if ((int)visible_rows_.size() > max_visible_rows_) - owner_->extents_changed(false, true); + if ((int)visible_rows_.size() > max_visible_rows_) { + max_visible_rows_ = (int)visible_rows_.size(); - // Update the maximum row count if needed - max_visible_rows_ = max(max_visible_rows_, (int)visible_rows_.size()); + // Call order is important, otherwise the lazy event handler won't work + owner_->extents_changed(false, true); + owner_->row_item_appearance_changed(false, true); + } } void DecodeTrace::paint_fore(QPainter &p, ViewItemPaintParams &pp) @@ -948,6 +950,10 @@ void DecodeTrace::on_delete_decoder(int index) { decode_signal_->remove_decoder(index); + // Force re-calculation of the trace height, see paint_mid() + max_visible_rows_ = 0; + owner_->extents_changed(false, true); + // Update the popup create_popup_form(); } @@ -959,6 +965,12 @@ void DecodeTrace::on_show_hide_decoder(int index) assert(index < (int)decoder_forms_.size()); decoder_forms_[index]->set_decoder_visible(state); + if (!state) { + // Force re-calculation of the trace height, see paint_mid() + max_visible_rows_ = 0; + owner_->extents_changed(false, true); + } + if (owner_) owner_->row_item_appearance_changed(false, true); }