From: Soeren Apel Date: Fri, 14 Jul 2017 16:24:32 +0000 (+0200) Subject: DecodeTrace: Resize trace when hiding/deleting a stacked PD X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ded43869b4d6169b7f269af0623ef0a682e5b910;p=pulseview.git DecodeTrace: Resize trace when hiding/deleting a stacked PD The trace height depends on DecodeTrace::max_visible_rows_, which needs to be updated when a stacked PD is hidden or deleted. In order to do this, we reset max_visible_rows_ to 0 and then request a repaint. --- diff --git a/pv/views/trace/decodetrace.cpp b/pv/views/trace/decodetrace.cpp index 9529c50a..b4857336 100644 --- a/pv/views/trace/decodetrace.cpp +++ b/pv/views/trace/decodetrace.cpp @@ -950,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(); } @@ -961,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); }