TabularDecView: Fix some UI issues
authorSoeren Apel <soeren@apelpie.net>
Sat, 11 Jul 2020 20:28:11 +0000 (22:28 +0200)
committerSoeren Apel <soeren@apelpie.net>
Sat, 11 Jul 2020 20:31:23 +0000 (22:31 +0200)
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

pv/views/tabular_decoder/model.cpp
pv/views/tabular_decoder/view.cpp

index d85bf6aac7721d38106292254b811c30896426e7..e7a199f13da19248016e61e16d4c9065e1ac589f 100644 (file)
@@ -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()) {
index 91bcaea197bee2a0645d9f314fb77c2f5053df21..0aca4790e8ecc6d984df00129811a1a82fae7077 100644 (file)
@@ -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()