From: Soeren Apel Date: Sat, 11 Jul 2020 20:28:11 +0000 (+0200) Subject: TabularDecView: Fix some UI issues X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=b36ba61198551c5994c9b3210b07109ac0d87829 TabularDecView: Fix some UI issues 1) Window didn't immediately show when signal color was changed 2) Removing a PD and adding another caused the window to stay empty forever if "hide hidden" was enabled 3) Changing the PD showed the previous PD's content in the window until the mouse cursor moved into the main trace view to cause a repaint --- diff --git a/pv/views/tabular_decoder/model.cpp b/pv/views/tabular_decoder/model.cpp index d85bf6aa..e7a199f1 100644 --- a/pv/views/tabular_decoder/model.cpp +++ b/pv/views/tabular_decoder/model.cpp @@ -237,9 +237,10 @@ void AnnotationCollectionModel::set_signal_and_segment(data::DecodeSignal* signa connect(dec.get(), SIGNAL(annotation_visibility_changed()), this, SLOT(on_annotation_visibility_changed())); - if (hide_hidden_) + if (hide_hidden_) { update_annotations_without_hidden(); - else + dataset_ = &all_annotations_without_hidden_; + } else dataset_ = all_annotations_; if (!dataset_ || dataset_->empty()) { diff --git a/pv/views/tabular_decoder/view.cpp b/pv/views/tabular_decoder/view.cpp index 91bcaea1..0aca4790 100644 --- a/pv/views/tabular_decoder/view.cpp +++ b/pv/views/tabular_decoder/view.cpp @@ -470,6 +470,9 @@ void View::on_selected_decoder_changed(int index) } update_data(); + + // Force repaint, otherwise the new selection isn't shown for some reason + table_view_->viewport()->update(); } void View::on_hide_hidden_changed(bool checked) @@ -532,7 +535,8 @@ void View::on_signal_color_changed(const QColor &color) { (void)color; - table_view_->update(); + // Force immediate repaint, otherwise it's updated after the header popup is closed + table_view_->viewport()->update(); } void View::on_new_annotations()