diff --git a/src/AllPlotWindow.cpp b/src/AllPlotWindow.cpp index ce1bf47c0..62f2a462f 100644 --- a/src/AllPlotWindow.cpp +++ b/src/AllPlotWindow.cpp @@ -488,8 +488,7 @@ AllPlotWindow::configChanged() QPalette palette; palette.setBrush(QPalette::Background, QBrush(GColor(CRIDEPLOTBACKGROUND))); allPlotFrame->setPalette(palette); - stackFrame->setPalette(palette); - //stackWidget->setPalette(palette); + stackFrame->widget()->setPalette(palette); fullPlot->setCanvasBackground(GColor(CRIDEPLOTBACKGROUND)); // ok replot with the new config! @@ -1755,7 +1754,7 @@ AllPlotWindow::setupStackPlots() // set new widgets QWidget *stackWidget = new QWidget; stackWidget->setPalette(palette); - stackWidget->setAutoFillBackground(false); + stackWidget->setAutoFillBackground(true); stackWidget->setLayout(newLayout); stackFrame->setWidget(stackWidget); diff --git a/src/Colors.cpp b/src/Colors.cpp index 67458e0a1..78ba4dfd0 100644 --- a/src/Colors.cpp +++ b/src/Colors.cpp @@ -114,6 +114,7 @@ void GCColor::setupColors() { tr("Left Balance"), "CBALANCELEFT", QColor(178,0,0) }, { tr("Right Balance"), "CBALANCERIGHT", QColor(128,0,50) }, { tr("W' Balance"), "CWBAL", Qt::red }, + { tr("Ride CP Curve"), "CRIDECP", Qt::black }, { "", "", QColor(0,0,0) }, }; diff --git a/src/Colors.h b/src/Colors.h index 8e5c871dd..216e1390e 100644 --- a/src/Colors.h +++ b/src/Colors.h @@ -99,7 +99,7 @@ class ColorEngine : public QObject #define GColor(x) GCColor::getColor(x) // Define how many cconfigurable metric colors are available -#define CNUMOFCFGCOLORS 74 +#define CNUMOFCFGCOLORS 75 #define CPLOTBACKGROUND 0 #define CRIDEPLOTBACKGROUND 1 @@ -175,5 +175,6 @@ class ColorEngine : public QObject #define CBALANCELEFT 71 #define CBALANCERIGHT 72 #define CWBAL 73 +#define CRIDECP 74 #endif diff --git a/src/CpintPlot.cpp b/src/CpintPlot.cpp index 5c69bc7f8..138cff19d 100644 --- a/src/CpintPlot.cpp +++ b/src/CpintPlot.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include "RideItem.h" #include "LogTimeScaleDraw.h" #include "LogTimeScaleEngine.h" @@ -55,6 +56,7 @@ CpintPlot::CpintPlot(Context *context, QString p, const Zones *zones, bool range rangemode(rangemode) { setInstanceName("CP Plot"); + setAutoFillBackground(true); setAxisTitle(xBottom, tr("Interval Length")); LogTimeScaleDraw *ld = new LogTimeScaleDraw; @@ -95,6 +97,15 @@ CpintPlot::CpintPlot(Context *context, QString p, const Zones *zones, bool range void CpintPlot::configChanged() { + QPalette palette; + palette.setBrush(QPalette::Window, QBrush(GColor(CPLOTBACKGROUND))); + palette.setColor(QPalette::WindowText, GColor(CPLOTMARKER)); + palette.setColor(QPalette::Text, GColor(CPLOTMARKER)); + setPalette(palette); + + axisWidget(QwtPlot::xBottom)->setPalette(palette); + axisWidget(QwtPlot::yLeft)->setPalette(palette); + setCanvasBackground(GColor(CPLOTBACKGROUND)); //QPen gridPen(GColor(CPLOTGRID)); //gridPen.setStyle(Qt::DotLine); @@ -742,7 +753,7 @@ CpintPlot::calculate(RideItem *rideItem) thisCurve = new QwtPlotCurve(dateTime.toString(tr("ddd MMM d, yyyy h:mm AP"))); thisCurve->setRenderHint(QwtPlotItem::RenderAntialiased); QPen black; - black.setColor(Qt::black); + black.setColor(GColor(CRIDECP)); black.setWidth(2.0); thisCurve->setPen(black); thisCurve->attach(this); diff --git a/src/CriticalPowerWindow.cpp b/src/CriticalPowerWindow.cpp index 4b7823529..10c438787 100644 --- a/src/CriticalPowerWindow.cpp +++ b/src/CriticalPowerWindow.cpp @@ -259,7 +259,7 @@ CriticalPowerWindow::CriticalPowerWindow(const QDir &home, Context *context, boo // redraw on config change -- this seems the simplest approach connect(context, SIGNAL(filterChanged()), this, SLOT(forceReplot())); connect(context, SIGNAL(homeFilterChanged()), this, SLOT(forceReplot())); - connect(context, SIGNAL(configChanged()), this, SLOT(rideSelected())); + connect(context, SIGNAL(configChanged()), this, SLOT(configChanged())); connect(context->athlete->metricDB, SIGNAL(dataChanged()), this, SLOT(refreshRideSaved())); connect(context, SIGNAL(rideAdded(RideItem*)), this, SLOT(newRideAdded(RideItem*))); connect(context, SIGNAL(rideDeleted(RideItem*)), this, SLOT(newRideAdded(RideItem*))); @@ -270,6 +270,18 @@ CriticalPowerWindow::CriticalPowerWindow(const QDir &home, Context *context, boo connect(dateSetting, SIGNAL(useStandardRange()), this, SLOT(useStandardRange())); modelParametersChanged(); + + configChanged(); // get colors set +} + +void +CriticalPowerWindow::configChanged() +{ + QPalette palette; + palette.setBrush(QPalette::Background, QBrush(GColor(CRIDEPLOTBACKGROUND))); + setPalette(palette); + + rideSelected(); } void diff --git a/src/CriticalPowerWindow.h b/src/CriticalPowerWindow.h index 9e567f59a..5ab644ebf 100644 --- a/src/CriticalPowerWindow.h +++ b/src/CriticalPowerWindow.h @@ -143,6 +143,7 @@ class CriticalPowerWindow : public GcChartWindow void cpintTimeValueEntered(); void pickerMoved(const QPoint &pos); void rideSelected(); + void configChanged(); void intervalSelected(); void intervalsChanged(); void seasonSelected(int season); diff --git a/src/Season.h b/src/Season.h index 1fc8d6d93..6ccaf6c6e 100644 --- a/src/Season.h +++ b/src/Season.h @@ -50,6 +50,7 @@ class Season QDate getEnd(); int getSeed() { return _seed; } int getLow() { return _low; } + int getMaxRamp() { return _ramp; } QString getName(); int days() { return _days; } // how many days in the season, -1 if never ending int getType(); @@ -61,6 +62,7 @@ class Season void setType(int _type); void setSeed(int x) { _seed = x; } void setLow(int x) { _low = x; } + void setMaxRamp(int x) { _ramp = x; } QUuid id() const { return _id; } void setId(QUuid x) { _id = x; } QVector &load() { return _load; } @@ -70,6 +72,7 @@ class Season int _days; // how many days in this season? int _seed; int _low; // low point for SB .. default to -50 + int _ramp; // max ramp rate for CTL we want to see QUuid _id; // unique id QString name; // name, typically users name them by year e.g. "2011 Season"