mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user