]> sigrok.org Git - pulseview.git/commitdiff
Header: Invisible traces shouldn't influence the width.
authorJens Steinhauser <redacted>
Thu, 22 May 2014 20:03:28 +0000 (22:03 +0200)
committerJoel Holdsworth <redacted>
Fri, 23 May 2014 20:07:36 +0000 (21:07 +0100)
pv/view/header.cpp
pv/view/header.h

index a7902521216a90655ba708669ab5b36b2886f52b..e7bfcbf01a1df5e5d6febc762a8219c78fc4b3b6 100644 (file)
@@ -72,7 +72,10 @@ QSize Header::sizeHint() const
        const vector< shared_ptr<Trace> > traces(_view.get_traces());
        BOOST_FOREACH(shared_ptr<Trace> t, traces) {
                assert(t);
-               max_width = max(max_width, (int)t->get_label_rect(0).width());
+
+               if (t->enabled()) {
+                       max_width = max(max_width, (int)t->get_label_rect(0).width());
+               }
        }
 
        return QSize(max_width + Padding, 0);
@@ -281,9 +284,9 @@ void Header::on_signals_changed()
        BOOST_FOREACH(shared_ptr<Trace> t, traces) {
                assert(t);
                connect(t.get(), SIGNAL(visibility_changed()),
-                       this, SLOT(update()));
+                       this, SLOT(on_trace_changed()));
                connect(t.get(), SIGNAL(text_changed()),
-                       this, SLOT(on_trace_text_changed()));
+                       this, SLOT(on_trace_changed()));
                connect(t.get(), SIGNAL(colour_changed()),
                        this, SLOT(update()));
        }
@@ -294,7 +297,7 @@ void Header::on_signals_moved()
        update();
 }
 
-void Header::on_trace_text_changed()
+void Header::on_trace_changed()
 {
        update();
        geometry_updated();
index 5474f10eb48bcac2461f8d58546605e86d409173..489a5caaff996cf87d308f0e7a74572f789aac37 100644 (file)
@@ -74,7 +74,7 @@ private slots:
 
        void on_signals_moved();
 
-       void on_trace_text_changed();
+       void on_trace_changed();
 
 signals:
        void signals_moved();