From c934e8b4d08ceb384d3404c2c6a20145ffab41fc Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Fri, 23 Jan 2015 12:06:03 +0000 Subject: [PATCH] Aesthetic Tweaks .. tile mode highlights on mouse over for a more fluid feel, and better feedback .. can customise the trend view charts background .. fixed a SEGV on apply preset in chart setup .. this is part of a set of updates to update the standard setup to be more complete so the user can pretty much run off a standard config. --- src/CPPlot.cpp | 6 +- src/Colors.cpp | 6 +- src/Colors.h | 187 ++++++++++++++++++------------------ src/CriticalPowerWindow.cpp | 18 +++- src/GoldenCheetah.cpp | 16 ++- src/GoldenCheetah.h | 5 + src/HistogramWindow.cpp | 3 +- src/HomeWindow.cpp | 5 +- src/LTMPlot.cpp | 4 +- src/LTMWindow.cpp | 14 ++- src/PowerHist.cpp | 21 ++-- src/RideSummaryWindow.cpp | 18 ++-- src/TreeMapPlot.cpp | 2 +- src/TreeMapWindow.cpp | 2 +- 14 files changed, 176 insertions(+), 131 deletions(-) diff --git a/src/CPPlot.cpp b/src/CPPlot.cpp index 9d9cb1bf3..520e7a493 100644 --- a/src/CPPlot.cpp +++ b/src/CPPlot.cpp @@ -112,7 +112,8 @@ void CPPlot::configChanged(qint32) { QPalette palette; - palette.setBrush(QPalette::Window, QBrush(GColor(CPLOTBACKGROUND))); + if (rangemode) palette.setBrush(QPalette::Window, QBrush(GColor(CTRENDPLOTBACKGROUND))); + else palette.setBrush(QPalette::Window, QBrush(GColor(CPLOTBACKGROUND))); palette.setColor(QPalette::WindowText, GColor(CPLOTMARKER)); palette.setColor(QPalette::Text, GColor(CPLOTMARKER)); setPalette(palette); @@ -121,7 +122,8 @@ CPPlot::configChanged(qint32) axisWidget(QwtPlot::yLeft)->setPalette(palette); axisWidget(QwtPlot::yRight)->setPalette(palette); - setCanvasBackground(GColor(CPLOTBACKGROUND)); + if (rangemode) setCanvasBackground(GColor(CTRENDPLOTBACKGROUND)); + else setCanvasBackground(GColor(CPLOTBACKGROUND)); } // get the fonts and colors right for the axis scales diff --git a/src/Colors.cpp b/src/Colors.cpp index ab3e77f44..1c22c1aaf 100644 --- a/src/Colors.cpp +++ b/src/Colors.cpp @@ -63,6 +63,7 @@ void GCColor::setupColors() Colors init[CNUMOFCFGCOLORS+1] = { { tr("Plot Background"), "COLORPLOTBACKGROUND", QColor(52,52,52) }, { tr("Ride Plot Background"), "COLORRIDEPLOTBACKGROUND", QColor(52,52,52) }, + { tr("Trend Plot Background"), "COLORTRENDPLOTBACKGROUND", Qt::black }, { tr("Train Plot Background"), "COLORTRAINPLOTBACKGROUND", Qt::black }, { tr("Plot Symbols"), "COLORRIDEPLOTSYMBOLS", Qt::cyan }, { tr("Ride Plot X Axis"), "COLORRIDEPLOTXAXIS", Qt::blue }, @@ -337,9 +338,9 @@ ColorEngine::colorFor(QString text) } QString -GCColor::css() +GCColor::css(bool ridesummary) { - QColor bgColor = GColor(CPLOTBACKGROUND); + QColor bgColor = ridesummary ? GColor(CPLOTBACKGROUND) : GColor(CTRENDPLOTBACKGROUND); QColor fgColor = GCColor::invertColor(bgColor); //QColor altColor = GCColor::alternateColor(bgColor); // not yet ? @@ -598,6 +599,7 @@ GCColor::applyTheme(int index) case CPLOTBACKGROUND: case CRIDEPLOTBACKGROUND: + case CTRENDPLOTBACKGROUND: case CTRAINPLOTBACKGROUND: color = theme.colors[0]; // background color break; diff --git a/src/Colors.h b/src/Colors.h index 338d7ac30..a7476cd07 100644 --- a/src/Colors.h +++ b/src/Colors.h @@ -111,7 +111,7 @@ class GCColor : public QObject // for styling things with current preferences static bool isFlat(); static QLinearGradient linearGradient(int size, bool active, bool alternate=false); - static QString css(); + static QString css(bool trend=false); static QPalette palette(); static QString stylesheet(); static void readConfig(); @@ -144,100 +144,101 @@ class ColorEngine : public QObject #define GColor(x) GCColor::getColor(x) // Define how many cconfigurable metric colors are available -#define CNUMOFCFGCOLORS 93 +#define CNUMOFCFGCOLORS 94 #define CPLOTBACKGROUND 0 #define CRIDEPLOTBACKGROUND 1 -#define CTRAINPLOTBACKGROUND 2 -#define CPLOTSYMBOL 3 -#define CRIDEPLOTXAXIS 4 -#define CRIDEPLOTYAXIS 5 -#define CPLOTTHUMBNAIL 6 -#define CPLOTTITLE 7 -#define CPLOTSELECT 8 -#define CPLOTTRACKER 9 -#define CPLOTMARKER 10 -#define CPLOTGRID 11 -#define CINTERVALHIGHLIGHTER 12 -#define CHEARTRATE 13 -#define CSPEED 14 -#define CACCELERATION 15 -#define CPOWER 16 -#define CNPOWER 17 -#define CXPOWER 18 -#define CAPOWER 19 -#define CCP 20 -#define CCADENCE 21 -#define CALTITUDE 22 -#define CALTITUDEBRUSH 23 -#define CWINDSPEED 24 -#define CTORQUE 25 -#define CSLOPE 26 -#define CGEAR 27 -#define CRV 28 -#define CRCAD 29 -#define CRGCT 30 -#define CSMO2 31 -#define CTHB 32 -#define CO2HB 33 -#define CHHB 34 -#define CLOAD 35 -#define CTSS 36 -#define CSTS 37 -#define CLTS 38 -#define CSB 39 -#define CDAILYSTRESS 40 -#define CBIKESCORE 41 -#define CCALENDARTEXT 42 -#define CZONE1 43 -#define CZONE2 44 -#define CZONE3 45 -#define CZONE4 46 -#define CZONE5 47 -#define CZONE6 48 -#define CZONE7 49 -#define CZONE8 50 -#define CZONE9 51 -#define CZONE10 52 -#define CHZONE1 53 -#define CHZONE2 54 -#define CHZONE3 55 -#define CHZONE4 56 -#define CHZONE5 57 -#define CHZONE6 58 -#define CHZONE7 59 -#define CHZONE8 60 -#define CHZONE9 61 -#define CHZONE10 62 -#define CAEROVE 63 -#define CAEROEL 64 -#define CCALCELL 65 -#define CCALHEAD 66 -#define CCALCURRENT 67 -#define CCALACTUAL 68 -#define CCALPLANNED 69 -#define CCALTODAY 70 -#define CPOPUP 71 -#define CPOPUPTEXT 72 -#define CTILEBAR 73 -#define CTILEBARSELECT 74 -#define CTOOLBAR 75 -#define CRIDEGROUP 76 -#define CSPINSCANLEFT 77 -#define CSPINSCANRIGHT 78 -#define CTEMP 79 -#define CDIAL 80 -#define CALTPOWER 81 -#define CBALANCELEFT 82 -#define CBALANCERIGHT 83 -#define CWBAL 84 -#define CRIDECP 85 -#define CATISS 86 -#define CANTISS 87 -#define CLTE 88 -#define CRTE 89 -#define CLPS 90 -#define CRPS 91 -#define CCHROME 92 +#define CTRENDPLOTBACKGROUND 2 +#define CTRAINPLOTBACKGROUND 3 +#define CPLOTSYMBOL 4 +#define CRIDEPLOTXAXIS 5 +#define CRIDEPLOTYAXIS 6 +#define CPLOTTHUMBNAIL 7 +#define CPLOTTITLE 8 +#define CPLOTSELECT 9 +#define CPLOTTRACKER 10 +#define CPLOTMARKER 11 +#define CPLOTGRID 12 +#define CINTERVALHIGHLIGHTER 13 +#define CHEARTRATE 14 +#define CSPEED 15 +#define CACCELERATION 16 +#define CPOWER 17 +#define CNPOWER 18 +#define CXPOWER 19 +#define CAPOWER 20 +#define CCP 21 +#define CCADENCE 22 +#define CALTITUDE 23 +#define CALTITUDEBRUSH 24 +#define CWINDSPEED 25 +#define CTORQUE 26 +#define CSLOPE 27 +#define CGEAR 28 +#define CRV 29 +#define CRCAD 30 +#define CRGCT 31 +#define CSMO2 32 +#define CTHB 33 +#define CO2HB 34 +#define CHHB 35 +#define CLOAD 36 +#define CTSS 37 +#define CSTS 38 +#define CLTS 39 +#define CSB 40 +#define CDAILYSTRESS 41 +#define CBIKESCORE 42 +#define CCALENDARTEXT 43 +#define CZONE1 44 +#define CZONE2 45 +#define CZONE3 46 +#define CZONE4 47 +#define CZONE5 48 +#define CZONE6 49 +#define CZONE7 50 +#define CZONE8 51 +#define CZONE9 52 +#define CZONE10 53 +#define CHZONE1 54 +#define CHZONE2 55 +#define CHZONE3 56 +#define CHZONE4 57 +#define CHZONE5 58 +#define CHZONE6 59 +#define CHZONE7 60 +#define CHZONE8 61 +#define CHZONE9 62 +#define CHZONE10 63 +#define CAEROVE 64 +#define CAEROEL 65 +#define CCALCELL 66 +#define CCALHEAD 67 +#define CCALCURRENT 68 +#define CCALACTUAL 69 +#define CCALPLANNED 70 +#define CCALTODAY 71 +#define CPOPUP 72 +#define CPOPUPTEXT 73 +#define CTILEBAR 74 +#define CTILEBARSELECT 75 +#define CTOOLBAR 76 +#define CRIDEGROUP 77 +#define CSPINSCANLEFT 78 +#define CSPINSCANRIGHT 79 +#define CTEMP 80 +#define CDIAL 81 +#define CALTPOWER 82 +#define CBALANCELEFT 83 +#define CBALANCERIGHT 84 +#define CWBAL 85 +#define CRIDECP 86 +#define CATISS 87 +#define CANTISS 88 +#define CLTE 89 +#define CRTE 90 +#define CLPS 91 +#define CRPS 92 +#define CCHROME 93 #endif diff --git a/src/CriticalPowerWindow.cpp b/src/CriticalPowerWindow.cpp index 427a771e9..dc3a2edff 100644 --- a/src/CriticalPowerWindow.cpp +++ b/src/CriticalPowerWindow.cpp @@ -508,20 +508,28 @@ CriticalPowerWindow::CriticalPowerWindow(Context *context, bool rangemode) : void CriticalPowerWindow::configChanged(qint32) { - setProperty("color", GColor(CPLOTBACKGROUND)); + if (rangemode) setProperty("color", GColor(CTRENDPLOTBACKGROUND)); + else setProperty("color", GColor(CPLOTBACKGROUND)); // tinted palette for headings etc QPalette palette; - palette.setBrush(QPalette::Window, QBrush(GColor(CPLOTBACKGROUND))); + if (rangemode) palette.setBrush(QPalette::Window, QBrush(GColor(CTRENDPLOTBACKGROUND))); + else palette.setBrush(QPalette::Window, QBrush(GColor(CPLOTBACKGROUND))); palette.setColor(QPalette::WindowText, GColor(CPLOTMARKER)); palette.setColor(QPalette::Text, GColor(CPLOTMARKER)); setPalette(palette); // inverted palette for data etc QPalette whitepalette; - whitepalette.setBrush(QPalette::Window, QBrush(GColor(CPLOTBACKGROUND))); - whitepalette.setColor(QPalette::WindowText, GCColor::invertColor(GColor(CPLOTBACKGROUND))); - whitepalette.setColor(QPalette::Text, GCColor::invertColor(GColor(CPLOTBACKGROUND))); + if (rangemode) { + whitepalette.setBrush(QPalette::Window, QBrush(GColor(CTRENDPLOTBACKGROUND))); + whitepalette.setColor(QPalette::WindowText, GCColor::invertColor(GColor(CTRENDPLOTBACKGROUND))); + whitepalette.setColor(QPalette::Text, GCColor::invertColor(GColor(CTRENDPLOTBACKGROUND))); + } else { + whitepalette.setBrush(QPalette::Window, QBrush(GColor(CPLOTBACKGROUND))); + whitepalette.setColor(QPalette::WindowText, GCColor::invertColor(GColor(CPLOTBACKGROUND))); + whitepalette.setColor(QPalette::Text, GCColor::invertColor(GColor(CPLOTBACKGROUND))); + } QFont font; font.setPointSize(12); // reasonably big diff --git a/src/GoldenCheetah.cpp b/src/GoldenCheetah.cpp index 5179cea7d..326a9fd9b 100644 --- a/src/GoldenCheetah.cpp +++ b/src/GoldenCheetah.cpp @@ -205,7 +205,7 @@ GcWindow::GcWindow() menu->addAction(tr("Close"), this, SLOT(_closeWindow())); menuButton->hide(); - menuButton->move(0,0); + menuButton->move(1,1); } GcWindow::GcWindow(Context *context) : QFrame(context->mainWindow), dragState(None) @@ -241,8 +241,8 @@ GcWindow::GcWindow(Context *context) : QFrame(context->mainWindow), dragState(No menuButton->setMenu(menu); menu->addAction(tr("Close"), this, SLOT(_closeWindow())); - //menuButton->hide(); - menuButton->move(0,0); + menuButton->hide(); + menuButton->move(1,1); } GcWindow::~GcWindow() @@ -325,10 +325,15 @@ GcWindow::paintEvent(QPaintEvent * /*event*/) // border painter.setBrush(Qt::NoBrush); - if (underMouse()) { + if (underMouse() && property("style") == 2) { QPixmap sized = closeImage.scaled(QSize(contentsMargins().top()-6, contentsMargins().top()-6)); + QRect all(0,0,width()-1,height()-1); + QPen pen(GColor(CPLOTMARKER)); + pen.setWidth(1); + painter.setPen(pen); + painter.drawRect(all); } else { painter.setPen(Qt::darkGray); @@ -338,7 +343,8 @@ GcWindow::paintEvent(QPaintEvent * /*event*/) // background light gray for now? QRect all(0,0,width(),height()); if (property("isManager").toBool() == true) { - painter.fillRect(all, QColor("#B3B4BA")); + //painter.fillRect(all, QColor("#B3B4BA")); + painter.fillRect(all, GColor(CPLOTBACKGROUND)); } } } diff --git a/src/GoldenCheetah.h b/src/GoldenCheetah.h index 7dd4b83ee..fb2c4cb45 100644 --- a/src/GoldenCheetah.h +++ b/src/GoldenCheetah.h @@ -79,6 +79,7 @@ private: Q_PROPERTY(double heightFactor READ heightFactor WRITE setHeightFactor NOTIFY heightFactorChanged USER true) // can be resized + Q_PROPERTY(int style READ style WRITE setStyle USER true) Q_PROPERTY(bool resizable READ resizable WRITE setResizable USER true) Q_PROPERTY(bool gripped READ gripped WRITE setGripped) @@ -97,6 +98,7 @@ private: double _heightFactor; bool _resizable; bool _gripped; + int _style; enum drag { None, Close, Flip, Move, Left, Right, Top, Bottom, TLCorner, TRCorner, BLCorner, BRCorner }; typedef enum drag DragState; @@ -169,6 +171,9 @@ public: void setGripped(bool); bool gripped() const; + int style() const { return _style; } + void setStyle(int x) { _style = x; } + GcWinID type() const { return _type; } void setType(GcWinID x) { _type = x; } // only really used by the window registry diff --git a/src/HistogramWindow.cpp b/src/HistogramWindow.cpp index 222f9c02e..1802f3c39 100644 --- a/src/HistogramWindow.cpp +++ b/src/HistogramWindow.cpp @@ -346,7 +346,8 @@ HistogramWindow::HistogramWindow(Context *context, bool rangemode) : GcChartWind void HistogramWindow::configChanged(qint32 state) { - setProperty("color", GColor(CPLOTBACKGROUND)); // called on config change + if (!rangemode) setProperty("color", GColor(CPLOTBACKGROUND)); // called on config change + else setProperty("color", GColor(CTRENDPLOTBACKGROUND)); // called on config change powerHist->configChanged(state); } diff --git a/src/HomeWindow.cpp b/src/HomeWindow.cpp index 26fd53c79..67ad8476b 100644 --- a/src/HomeWindow.cpp +++ b/src/HomeWindow.cpp @@ -79,7 +79,8 @@ HomeWindow::HomeWindow(Context *context, QString name, QString /* windowtitle */ layout->addWidget(style); QPalette palette; - palette.setBrush(backgroundRole(), QColor("#B3B4B6")); + //palette.setBrush(backgroundRole(), QColor("#B3B4B6")); + palette.setBrush(backgroundRole(), GColor(CPLOTBACKGROUND)); setAutoFillBackground(false); // each style has its own container widget @@ -397,6 +398,7 @@ HomeWindow::styleChanged(int id) default: break; } + charts[i]->setProperty("style", id); } @@ -516,6 +518,7 @@ HomeWindow::addChart(GcWindow* newone) RideItem *notconst = (RideItem*)context->currentRideItem(); newone->setProperty("ride", QVariant::fromValue(notconst)); newone->setProperty("dateRange", property("dateRange")); + newone->setProperty("style", currentStyle); // add to tabs switch (currentStyle) { diff --git a/src/LTMPlot.cpp b/src/LTMPlot.cpp index 458b82c10..566e2d5e4 100644 --- a/src/LTMPlot.cpp +++ b/src/LTMPlot.cpp @@ -143,13 +143,13 @@ void LTMPlot::configChanged(qint32) { // set basic plot colors - setCanvasBackground(GColor(CPLOTBACKGROUND)); + setCanvasBackground(GColor(CTRENDPLOTBACKGROUND)); QPen gridPen(GColor(CPLOTGRID)); //gridPen.setStyle(Qt::DotLine); grid->setPen(gridPen); QPalette palette; - palette.setBrush(QPalette::Window, QBrush(GColor(CPLOTBACKGROUND))); + palette.setBrush(QPalette::Window, QBrush(GColor(CTRENDPLOTBACKGROUND))); palette.setColor(QPalette::WindowText, GColor(CPLOTMARKER)); palette.setColor(QPalette::Text, GColor(CPLOTMARKER)); setPalette(palette); diff --git a/src/LTMWindow.cpp b/src/LTMWindow.cpp index aa1bd4e68..dded0ebc2 100644 --- a/src/LTMWindow.cpp +++ b/src/LTMWindow.cpp @@ -57,7 +57,7 @@ LTMWindow::LTMWindow(Context *context) : // the stack of plots QPalette palette; - palette.setBrush(QPalette::Background, QBrush(GColor(CPLOTBACKGROUND))); + palette.setBrush(QPalette::Background, QBrush(GColor(CTRENDPLOTBACKGROUND))); plotsWidget = new QWidget(this); plotsWidget->setPalette(palette); @@ -613,7 +613,7 @@ LTMWindow::useThruToday() void LTMWindow::refresh() { - setProperty("color", GColor(CPLOTBACKGROUND)); // called on config change + setProperty("color", GColor(CTRENDPLOTBACKGROUND)); // called on config change // not if in compare mode if (isCompare()) return; @@ -816,6 +816,14 @@ LTMWindow::applyClicked() settings.start = start; settings.end = end; + // Set the specification + FilterSet fs; + fs.addFilter(context->isfiltered, context->filters); + fs.addFilter(context->ishomefiltered, context->homeFilters); + fs.addFilter(ltmTool->isFiltered(), ltmTool->filters()); + settings.specification.setFilterSet(fs); + settings.specification.setDateRange(DateRange(settings.start.date(), settings.end.date())); + ltmTool->applySettings(); refresh(); } @@ -910,7 +918,7 @@ LTMWindow::dataTable(bool html) // now set to new (avoids a weird crash) QString summary; - QColor bgColor = GColor(CPLOTBACKGROUND); + QColor bgColor = GColor(CTRENDPLOTBACKGROUND); QColor altColor = GCColor::alternateColor(bgColor); // html page prettified with a title diff --git a/src/PowerHist.cpp b/src/PowerHist.cpp index cf42346e4..71e9867b6 100644 --- a/src/PowerHist.cpp +++ b/src/PowerHist.cpp @@ -129,7 +129,8 @@ void PowerHist::configChanged(qint32) { // plot background - setCanvasBackground(GColor(CPLOTBACKGROUND)); + if (rangemode) setCanvasBackground(GColor(CTRENDPLOTBACKGROUND)); + else setCanvasBackground(GColor(CPLOTBACKGROUND)); // curve QPen pen; @@ -185,7 +186,8 @@ PowerHist::configChanged(qint32) } // use a linear gradient - brush_color.setAlpha(GColor(CPLOTBACKGROUND) == QColor(Qt::white) ? 64 : 200); + if (rangemode) brush_color.setAlpha(GColor(CTRENDPLOTBACKGROUND) == QColor(Qt::white) ? 64 : 200); + else brush_color.setAlpha(GColor(CPLOTBACKGROUND) == QColor(Qt::white) ? 64 : 200); QColor brush_color1 = brush_color.darker(); QLinearGradient linearGradient(0, 0, 0, height()); linearGradient.setColorAt(0.0, brush_color); @@ -207,7 +209,8 @@ PowerHist::configChanged(qint32) ivl.setWidth(width); curveSelected->setPen(ivl); QColor ivlbrush = GColor(CINTERVALHIGHLIGHTER); - ivlbrush.setAlpha(GColor(CPLOTBACKGROUND) == QColor(Qt::white) ? 64 : 200); + if (rangemode) ivlbrush.setAlpha(GColor(CTRENDPLOTBACKGROUND) == QColor(Qt::white) ? 64 : 200); + else ivlbrush.setAlpha(GColor(CPLOTBACKGROUND) == QColor(Qt::white) ? 64 : 200); curveSelected->setBrush(ivlbrush); // fill below the line // hover curve @@ -215,7 +218,8 @@ PowerHist::configChanged(qint32) hvl.setWidth(width); curveHover->setPen(hvl); QColor hvlbrush = QColor(Qt::darkGray); - hvlbrush.setAlpha((GColor(CPLOTBACKGROUND) == QColor(Qt::white) ? 64 : 200)); + if (rangemode) hvlbrush.setAlpha((GColor(CTRENDPLOTBACKGROUND) == QColor(Qt::white) ? 64 : 200)); + else hvlbrush.setAlpha((GColor(CPLOTBACKGROUND) == QColor(Qt::white) ? 64 : 200)); curveHover->setBrush(hvlbrush); // fill below the line // grid @@ -224,7 +228,8 @@ PowerHist::configChanged(qint32) grid->setPen(gridPen); QPalette palette; - palette.setBrush(QPalette::Window, QBrush(GColor(CPLOTBACKGROUND))); + if (rangemode) palette.setBrush(QPalette::Window, QBrush(GColor(CTRENDPLOTBACKGROUND))); + else palette.setBrush(QPalette::Window, QBrush(GColor(CPLOTBACKGROUND))); palette.setColor(QPalette::WindowText, GColor(CPLOTMARKER)); palette.setColor(QPalette::Text, GColor(CPLOTMARKER)); setPalette(palette); @@ -1477,7 +1482,8 @@ PowerHist::setDataFromCompare() newCurve->setPen(pen); QColor brush_color = color; - brush_color.setAlpha(GColor(CPLOTBACKGROUND) == QColor(Qt::white) ? 120 : 200); + if (rangemode) brush_color.setAlpha(GColor(CTRENDPLOTBACKGROUND) == QColor(Qt::white) ? 120 : 200); + else brush_color.setAlpha(GColor(CPLOTBACKGROUND) == QColor(Qt::white) ? 120 : 200); QColor brush_color1 = brush_color.darker(); //QLinearGradient linearGradient(0, 0, 0, height()); //linearGradient.setColorAt(0.0, brush_color); @@ -1589,7 +1595,8 @@ PowerHist::setDataFromCompare(QString totalMetric, QString distMetric) newCurve->setPen(pen); QColor brush_color = cd.color; - brush_color.setAlpha(GColor(CPLOTBACKGROUND) == QColor(Qt::white) ? 120 : 200); + if (rangemode) brush_color.setAlpha(GColor(CTRENDPLOTBACKGROUND) == QColor(Qt::white) ? 120 : 200); + else brush_color.setAlpha(GColor(CPLOTBACKGROUND) == QColor(Qt::white) ? 120 : 200); QColor brush_color1 = brush_color.darker(); //QLinearGradient linearGradient(0, 0, 0, height()); //linearGradient.setColorAt(0.0, brush_color); diff --git a/src/RideSummaryWindow.cpp b/src/RideSummaryWindow.cpp index 917b5192d..b1259e8aa 100644 --- a/src/RideSummaryWindow.cpp +++ b/src/RideSummaryWindow.cpp @@ -139,7 +139,8 @@ RideSummaryWindow::~RideSummaryWindow() void RideSummaryWindow::configChanged(qint32) { - setProperty("color", GColor(CPLOTBACKGROUND)); // called on config change + if (ridesummary) setProperty("color", GColor(CPLOTBACKGROUND)); // called on config change + else setProperty("color", GColor(CTRENDPLOTBACKGROUND)); // called on config change QFont defaultFont; defaultFont.fromString(appsettings->value(NULL, GC_FONT_DEFAULT, QFont().toString()).toString()); @@ -328,7 +329,7 @@ RideSummaryWindow::refresh() // if we're summarising a ride but have no ride to summarise if (ridesummary && !myRideItem) { setSubTitle(tr("Summary")); - rideSummary->page()->mainFrame()->setHtml(GCColor::css()); + rideSummary->page()->mainFrame()->setHtml(GCColor::css(ridesummary)); return; } @@ -390,7 +391,7 @@ QString RideSummaryWindow::htmlSummary() { QString summary(""); - QColor bgColor = GColor(CPLOTBACKGROUND); + QColor bgColor = ridesummary ? GColor(CPLOTBACKGROUND) : GColor(CTRENDPLOTBACKGROUND); //QColor fgColor = GCColor::invertColor(bgColor); QColor altColor = GCColor::alternateColor(bgColor); @@ -415,7 +416,7 @@ RideSummaryWindow::htmlSummary() } // set those colors - summary = GCColor::css(); + summary = GCColor::css(ridesummary); summary += "
"; // device summary for ride summary, otherwise how many activities? @@ -546,7 +547,8 @@ RideSummaryWindow::htmlSummary() if (ridesummary) { // for rag reporting - QColor defaultColor = GCColor::invertColor(GColor(CPLOTBACKGROUND)); + QColor defaultColor = ridesummary ? GCColor::invertColor(GColor(CPLOTBACKGROUND)) : + GCColor::invertColor(GColor(CTRENDPLOTBACKGROUND)); // get the Coggan PMC and add values for date of ride summary += QString(tr("CTL:%1") @@ -1539,7 +1541,7 @@ RideSummaryWindow::htmlCompareSummary() const { QString summary; - QColor bgColor = GColor(CPLOTBACKGROUND); + QColor bgColor = ridesummary ? GColor(CPLOTBACKGROUND) : GColor(CTRENDPLOTBACKGROUND); //QColor fgColor = GCColor::invertColor(bgColor); QColor altColor = GCColor::alternateColor(bgColor); @@ -1651,7 +1653,7 @@ RideSummaryWindow::htmlCompareSummary() const } // LETS FORMAT THE HTML - summary = GCColor::css(); + summary = GCColor::css(ridesummary); summary += "
"; // @@ -1919,7 +1921,7 @@ RideSummaryWindow::htmlCompareSummary() const } else { // DATE RANGE COMPARE // LETS FORMAT THE HTML - summary = GCColor::css(); + summary = GCColor::css(ridesummary); summary += "
"; // get metric details here ... diff --git a/src/TreeMapPlot.cpp b/src/TreeMapPlot.cpp index 274964c54..8cf0fa8ad 100644 --- a/src/TreeMapPlot.cpp +++ b/src/TreeMapPlot.cpp @@ -100,7 +100,7 @@ TreeMapPlot::paintEvent(QPaintEvent *) // Init paint settings QPainter painter(this); - QColor color = GColor(CPLOTBACKGROUND); + QColor color = GColor(CTRENDPLOTBACKGROUND); QPen pen(color); pen.setWidth(10); // root QBrush brush(color); diff --git a/src/TreeMapWindow.cpp b/src/TreeMapWindow.cpp index 7963aab95..1b014d047 100644 --- a/src/TreeMapWindow.cpp +++ b/src/TreeMapWindow.cpp @@ -207,7 +207,7 @@ TreeMapWindow::refresh() { if (!amVisible()) return; - setProperty("color", GColor(CPLOTBACKGROUND)); + setProperty("color", GColor(CTRENDPLOTBACKGROUND)); // refresh for changes to ridefiles / zones if (active == false) {