From 99aee959a2b68b6b3d48b60e9d97dd5950fcb13f Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Wed, 12 Mar 2014 11:54:27 +0000 Subject: [PATCH] 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. --- src/LTMPlot.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/LTMPlot.cpp b/src/LTMPlot.cpp index 516269f76..13b994d59 100644 --- a/src/LTMPlot.cpp +++ b/src/LTMPlot.cpp @@ -150,7 +150,14 @@ LTMPlot::configUpdate() axisWidget(x)->setPalette(palette); } axisWidget(QwtPlot::xBottom)->setPalette(palette); - this->legend()->setPalette(palette); + QwtLegend *l = static_cast(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.."<