Fix LTM legend colours

.. when user changes the background color for charts the
   legend can be difficult to read as it is always in black.

.. we now update the legend and it's widgets to change the text
   color when the chart is refreshed.
This commit is contained in:
Mark Liversedge
2014-03-12 11:54:27 +00:00
parent ded1da5b0b
commit 99aee959a2

View File

@@ -150,7 +150,14 @@ LTMPlot::configUpdate()
axisWidget(x)->setPalette(palette);
}
axisWidget(QwtPlot::xBottom)->setPalette(palette);
this->legend()->setPalette(palette);
QwtLegend *l = static_cast<QwtLegend *>(this->legend());
l->setPalette(palette);
foreach(QwtPlotCurve *p, curves) {
foreach (QWidget *w, l->legendWidgets(itemToInfo(p))) {
w->setPalette(palette);
}
}
updateLegend();
}
void
@@ -1129,6 +1136,9 @@ LTMPlot::setData(LTMSettings *set)
//qDebug()<<"Final tidy.."<<timer.elapsed();
// update colours etc for plot chrome
configUpdate();
// plot
replot();