]> sigrok.org Git - pulseview.git/blobdiff - pv/view/view.cpp
Use nullptr in some more places.
[pulseview.git] / pv / view / view.cpp
index eeb8afd236529e442bac91d6f4eeae6b5a065f05..6ad7dea0822c0d6653a75b6b0ee2dd1e86a07e8b 100644 (file)
@@ -43,7 +43,6 @@
 #include <libsigrokcxx/libsigrokcxx.hpp>
 
 #include "analogsignal.hpp"
-#include "decodetrace.hpp"
 #include "header.hpp"
 #include "logicsignal.hpp"
 #include "ruler.hpp"
 #include "pv/data/logicsegment.hpp"
 #include "pv/util.hpp"
 
+#ifdef ENABLE_DECODE
+#include "decodetrace.hpp"
+#endif
+
 using boost::shared_lock;
 using boost::shared_mutex;
 
@@ -455,9 +458,11 @@ void View::enable_coloured_bg(bool state)
                if (l)
                        l->set_coloured_bg(state);
 
+#ifdef ENABLE_DECODE
                shared_ptr<DecodeTrace> d = dynamic_pointer_cast<DecodeTrace>(i);
                if (d)
                        d->set_coloured_bg(state);
+#endif
        }
 
        viewport_->update();
@@ -546,6 +551,12 @@ void View::restack_all_trace_tree_items()
        for (auto &o : sorted_owners)
                o->restack_items();
 
+       // Re-assign background colors
+       bool next_bgcolour_state = 0;
+
+       for (auto &o : sorted_owners)
+               next_bgcolour_state = o->reassign_bgcolour_states(next_bgcolour_state);
+
        // Animate the items to their destination
        for (const auto &i : items)
                i->animate_to_layout_v_offset();