X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fview.cpp;h=eeb8afd236529e442bac91d6f4eeae6b5a065f05;hp=c6a6afd323dcccac191061bfac65c640bac36c68;hb=574c568d184240cd87be1b57fc00d60a4eac7566;hpb=0fb9d6454c286869d71621b69515802903735057 diff --git a/pv/view/view.cpp b/pv/view/view.cpp index c6a6afd..eeb8afd 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -42,6 +42,7 @@ #include +#include "analogsignal.hpp" #include "decodetrace.hpp" #include "header.hpp" #include "logicsignal.hpp" @@ -437,6 +438,31 @@ void View::enable_sticky_scrolling(bool state) sticky_scrolling_ = state; } +void View::enable_coloured_bg(bool state) +{ + const vector> items( + list_by_type()); + + for (shared_ptr i : items) { + // Can't cast to Trace because it's abstract, so we need to + // check for any derived classes individually + + shared_ptr a = dynamic_pointer_cast(i); + if (a) + a->set_coloured_bg(state); + + shared_ptr l = dynamic_pointer_cast(i); + if (l) + l->set_coloured_bg(state); + + shared_ptr d = dynamic_pointer_cast(i); + if (d) + d->set_coloured_bg(state); + } + + viewport_->update(); +} + bool View::cursors_shown() const { return show_cursors_;