diff --git a/src/GUI/graphview.cpp b/src/GUI/graphview.cpp index ded23632..61f6abf9 100644 --- a/src/GUI/graphview.cpp +++ b/src/GUI/graphview.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -494,8 +495,23 @@ void GraphView::setPalette(const Palette &palette) _palette = palette; _palette.reset(); - for (int i = 0; i < _graphs.count(); i++) - _graphs.at(i)->setColor(_palette.nextColor()); + QSet secondary; + for (int i = 0; i < _graphs.count(); i++) { + GraphItem *g = _graphs[i]; + if (g->secondaryGraph()) + secondary.insert(g->secondaryGraph()); + } + + for (int i = 0; i < _graphs.count(); i++) { + GraphItem *g = _graphs[i]; + if (secondary.contains(g)) + continue; + + QColor color(_palette.nextColor()); + g->setColor(color); + if (g->secondaryGraph()) + g->secondaryGraph()->setColor(color); + } } void GraphView::setGraphWidth(int width) diff --git a/src/GUI/graphview.h b/src/GUI/graphview.h index 3cdf51e7..05ac6cb0 100644 --- a/src/GUI/graphview.h +++ b/src/GUI/graphview.h @@ -3,7 +3,6 @@ #include #include -#include #include "data/graph.h" #include "palette.h" #include "units.h"