From c74a1e76a3198dbb2d703bb371efaafb44446572 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Wed, 24 Nov 2021 13:45:00 +0000 Subject: [PATCH] Grouping Colors .. standard colors now belong to groups: * Chart - chart decorations e.g. grid lines * Data - data series e.g. Power * Gui - Gui elements e.g. toolbar background .. when selecting colors in user and trends charts we now filter out any colors that are not data related to make it easier for users to find a standard color. --- src/Gui/ColorButton.cpp | 2 + src/Gui/Colors.cpp | 218 ++++++++++++++++++++-------------------- src/Gui/Colors.h | 3 +- 3 files changed, 113 insertions(+), 110 deletions(-) diff --git a/src/Gui/ColorButton.cpp b/src/Gui/ColorButton.cpp index 80637c532..34f085162 100644 --- a/src/Gui/ColorButton.cpp +++ b/src/Gui/ColorButton.cpp @@ -129,6 +129,8 @@ GColorDialog::GColorDialog(QColor selected, QWidget *parent) : QDialog(parent), colorSet = GCColor::colorSet(); for (int i=0; colorSet[i].name != ""; i++) { + if (colorSet[i].group != tr("Data")) continue; + QTreeWidgetItem *add; ColorButton *colorButton = new ColorButton(this, colorSet[i].name, colorSet[i].color, false, true); // we can click the button to choose the color directly diff --git a/src/Gui/Colors.cpp b/src/Gui/Colors.cpp index b7f455c6f..2628f768b 100644 --- a/src/Gui/Colors.cpp +++ b/src/Gui/Colors.cpp @@ -125,121 +125,121 @@ void GCColor::setupColors() // consider removing when we can guarantee extended initialisation support in gcc // (c++0x not supported by Qt currently and not planned for 4.8 or 5.0) Colors init[CNUMOFCFGCOLORS+1] = { - { tr("Plot Background"), "COLORPLOTBACKGROUND", QColor(52,52,52) }, - { tr("Performance 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("Performance Plot X Axis"), "COLORRIDEPLOTXAXIS", Qt::blue }, - { tr("Performance Plot Y Axis"), "COLORRIDEPLOTYAXIS", Qt::red }, - { tr("Plot Thumbnail Background"), "COLORPLOTTHUMBNAIL", Qt::gray }, - { tr("Plot Title"), "COLORPLOTTITLE", Qt::gray }, - { tr("Plot Selection Pen"), "COLORPLOTSELECT", Qt::blue }, - { tr("Plot TrackerPen"), "COLORPLOTTRACKER", Qt::blue }, - { tr("Plot Markers"), "COLORPLOTMARKER", Qt::cyan }, - { tr("Plot Grid"), "COLORGRID", QColor(65,65,65) }, - { tr("Interval Highlighter"), "COLORINTERVALHIGHLIGHTER", Qt::blue }, - { tr("Heart Rate"), "COLORHEARTRATE", Qt::red }, - { tr("Core Temperature"), "COLORCORETEMP", QColor(255, 173, 92) }, - { tr("Speed"), "COLORSPEED", Qt::green }, - { tr("Acceleration"), "COLORACCEL", Qt::cyan }, - { tr("Power"), "COLORPOWER", Qt::yellow }, - { tr("Iso Power"), "CNPOWER", Qt::magenta }, - { tr("Skiba xPower"), "CXPOWER", Qt::magenta }, - { tr("Altitude Power"), "CAPOWER", Qt::magenta }, - { tr("Train Target Power"), "CTPOWER", Qt::blue }, - { tr("Critical Power"), "COLORCP", Qt::cyan }, - { tr("Cadence"), "COLORCADENCE", QColor(0,204,204) }, - { tr("Altitude"), "COLORALTITUTDE", QColor(Qt::gray) }, - { tr("Altitude Shading"), "COLORALTITUDESHADE", QColor(Qt::lightGray) }, - { tr("Wind Speed"), "COLORWINDSPEED", Qt::darkGreen }, - { tr("Torque"), "COLORTORQUE", Qt::magenta }, - { tr("Slope"), "CSLOPE", Qt::green }, - { tr("Gear Ratio"), "COLORGEAR", QColor(0xff, 0x90, 0x00) }, - { tr("Run Vertical Oscillation"), "COLORRVERT", QColor(0xff, 0x90, 0x00) }, // same as garmin connect colors - { tr("Run Cadence"), "COLORRCAD", QColor(0xff, 0x90, 0x00) }, // same as garmin connect colors - { tr("Run Ground Contact"), "COLORGCT", QColor(0xff, 0x90, 0x00) }, // same as garmin connect colors - { tr("Muscle Oxygen (SmO2)"), "COLORSMO2", QColor(0x00, 0x89, 0x77) }, // green same as moxy monitor - { tr("Haemoglobin Mass (tHb)"), "COLORTHB", QColor(0xa3,0x44,0x02) }, // brown same as moxy monitor - { tr("Oxygenated Haemoglobin (O2Hb)"), "CO2HB", QColor(0xd1,0x05,0x72) }, - { tr("Deoxygenated Haemoglobin (HHb)"), "CHHB", QColor(0x00,0x7f,0xcc) }, - { tr("Load"), "COLORLOAD", Qt::yellow }, - { tr("BikeStress"), "COLORTSS", Qt::green }, - { tr("Short Term Stress"), "COLORSTS", Qt::blue }, - { tr("Long Term Stress"), "COLORLTS", Qt::green }, - { tr("Stress Balance"), "COLORSB", QColor(180,140,140) }, - { tr("Daily Stress"), "COLORDAILYSTRESS", Qt::red }, - { "Bike Score (TM)", "COLORBIKESCORE", Qt::gray }, - { tr("Calendar Text"), "COLORCALENDARTEXT", Qt::gray }, - { tr("Power Zone 1 Shading"), "COLORZONE1", QColor(255,0,255) }, - { tr("Power Zone 2 Shading"), "COLORZONE2", QColor(42,0,255) }, - { tr("Power Zone 3 Shading"), "COLORZONE3", QColor(0,170,255) }, - { tr("Power Zone 4 Shading"), "COLORZONE4", QColor(0,255,128) }, - { tr("Power Zone 5 Shading"), "COLORZONE5", QColor(85,255,0) }, - { tr("Power Zone 6 Shading"), "COLORZONE6", QColor(255,213,0) }, - { tr("Power Zone 7 Shading"), "COLORZONE7", QColor(255,0,0) }, - { tr("Power Zone 8 Shading"), "COLORZONE8", Qt::gray }, - { tr("Power Zone 9 Shading"), "COLORZONE9", Qt::gray }, - { tr("Power Zone 10 Shading"), "COLORZONE10", Qt::gray }, - { tr("HR Zone 1 Shading"), "HRCOLORZONE1", QColor(255,0,255) }, - { tr("HR Zone 2 Shading"), "HRCOLORZONE2", QColor(42,0,255) }, - { tr("HR Zone 3 Shading"), "HRCOLORZONE3", QColor(0,170,255) }, - { tr("HR Zone 4 Shading"), "HRCOLORZONE4", QColor(0,255,128) }, - { tr("HR Zone 5 Shading"), "HRCOLORZONE5", QColor(85,255,0) }, - { tr("HR Zone 6 Shading"), "HRCOLORZONE6", QColor(255,213,0) }, - { tr("HR Zone 7 Shading"), "HRCOLORZONE7", QColor(255,0,0) }, - { tr("HR Zone 8 Shading"), "HRCOLORZONE8", Qt::gray }, - { tr("HR Zone 9 Shading"), "HRCOLORZONE9", Qt::gray }, - { tr("HR Zone 10 Shading"), "HRCOLORZONE10", Qt::gray }, - { tr("Aerolab Vrtual Elevation"), "COLORAEROVE", Qt::blue }, - { tr("Aerolab Elevation"), "COLORAEROEL", Qt::green }, - { tr("Calendar background"), "CCALCELL", Qt::white }, - { tr("Calendar heading"), "CCALHEAD", QColor(230,230,230) }, - { tr("Calendar Current Selection"), "CCALCURRENT", QColor(255,213,0) }, - { tr("Calendar Actual Workout"), "CCALACTUAL", Qt::green }, - { tr("Calendar Planned Workout"), "CCALPLANNED", Qt::yellow }, - { tr("Calendar Today"), "CCALTODAY", Qt::cyan }, - { tr("Pop Up Windows Background"), "CPOPUP", Qt::lightGray }, - { tr("Pop Up Windows Foreground"), "CPOPUPTEXT", Qt::white }, - { tr("Chart Bar Unselected"), "CTILEBAR", Qt::gray }, - { tr("Chart Bar Selected"), "CTILEBARSELECT", Qt::yellow }, - { tr("ToolBar Background"), "CTOOLBAR", Qt::white }, - { tr("Activity History Group"), "CRIDEGROUP", QColor(236,246,255) }, - { tr("SpinScan Left"), "CSPINSCANLEFT", Qt::gray }, - { tr("SpinScan Right"), "CSPINSCANRIGHT", Qt::cyan }, - { tr("Temperature"), "COLORTEMPERATURE", Qt::yellow }, - { tr("Default Dial Color"), "CDIAL", Qt::gray }, - { tr("Alternate Power"), "CALTPOWER", Qt::magenta }, - { tr("Left Balance"), "CBALANCELEFT", QColor(178,0,0) }, - { tr("Right Balance"), "CBALANCERIGHT", QColor(128,0,50) }, - { tr("W' Balance"), "CWBAL", Qt::red }, - { tr("Mean-maximal Power"), "CRIDECP", Qt::red }, - { tr("Aerobic TISS"), "CATISS", Qt::magenta }, - { tr("Anaerobic TISS"), "CANTISS", Qt::cyan }, - { tr("Left Torque Effectiveness"), "CLTE", Qt::cyan }, - { tr("Right Torque Effectiveness"), "CRTE", Qt::magenta }, - { tr("Left Pedal Smoothness"), "CLPS", Qt::cyan }, - { tr("Right Pedal Smoothness"), "CRPS", Qt::magenta }, + { tr("Chart"), tr("Plot Background"), "COLORPLOTBACKGROUND", QColor(52,52,52) }, + { tr("Chart"), tr("Performance Plot Background"), "COLORRIDEPLOTBACKGROUND", QColor(52,52,52) }, + { tr("Chart"), tr("Trend Plot Background"), "COLORTRENDPLOTBACKGROUND", Qt::black }, + { tr("Chart"), tr("Train Plot Background"), "COLORTRAINPLOTBACKGROUND", Qt::black }, + { tr("Chart"), tr("Plot Symbols"), "COLORRIDEPLOTSYMBOLS", Qt::cyan }, + { tr("Chart"), tr("Performance Plot X Axis"), "COLORRIDEPLOTXAXIS", Qt::blue }, + { tr("Chart"), tr("Performance Plot Y Axis"), "COLORRIDEPLOTYAXIS", Qt::red }, + { tr("Chart"), tr("Plot Thumbnail Background"), "COLORPLOTTHUMBNAIL", Qt::gray }, + { tr("Chart"), tr("Plot Title"), "COLORPLOTTITLE", Qt::gray }, + { tr("Chart"), tr("Plot Selection Pen"), "COLORPLOTSELECT", Qt::blue }, + { tr("Chart"), tr("Plot TrackerPen"), "COLORPLOTTRACKER", Qt::blue }, + { tr("Chart"), tr("Plot Markers"), "COLORPLOTMARKER", Qt::cyan }, + { tr("Chart"), tr("Plot Grid"), "COLORGRID", QColor(65,65,65) }, + { tr("Chart"), tr("Interval Highlighter"), "COLORINTERVALHIGHLIGHTER", Qt::blue }, + { tr("Data"), tr("Heart Rate"), "COLORHEARTRATE", Qt::red }, + { tr("Data"), tr("Core Temperature"), "COLORCORETEMP", QColor(255, 173, 92) }, + { tr("Data"), tr("Speed"), "COLORSPEED", Qt::green }, + { tr("Data"), tr("Acceleration"), "COLORACCEL", Qt::cyan }, + { tr("Data"), tr("Power"), "COLORPOWER", Qt::yellow }, + { tr("Data"), tr("Iso Power"), "CNPOWER", Qt::magenta }, + { tr("Data"), tr("Skiba xPower"), "CXPOWER", Qt::magenta }, + { tr("Data"), tr("Altitude Power"), "CAPOWER", Qt::magenta }, + { tr("Data"), tr("Train Target Power"), "CTPOWER", Qt::blue }, + { tr("Data"), tr("Critical Power"), "COLORCP", Qt::cyan }, + { tr("Data"), tr("Cadence"), "COLORCADENCE", QColor(0,204,204) }, + { tr("Data"), tr("Altitude"), "COLORALTITUTDE", QColor(Qt::gray) }, + { tr("Data"), tr("Altitude Shading"), "COLORALTITUDESHADE", QColor(Qt::lightGray) }, + { tr("Data"), tr("Wind Speed"), "COLORWINDSPEED", Qt::darkGreen }, + { tr("Data"), tr("Torque"), "COLORTORQUE", Qt::magenta }, + { tr("Data"), tr("Slope"), "CSLOPE", Qt::green }, + { tr("Data"), tr("Gear Ratio"), "COLORGEAR", QColor(0xff, 0x90, 0x00) }, + { tr("Data"), tr("Run Vertical Oscillation"), "COLORRVERT", QColor(0xff, 0x90, 0x00) }, // same as garmin connect colors + { tr("Data"), tr("Run Cadence"), "COLORRCAD", QColor(0xff, 0x90, 0x00) }, // same as garmin connect colors + { tr("Data"), tr("Run Ground Contact"), "COLORGCT", QColor(0xff, 0x90, 0x00) }, // same as garmin connect colors + { tr("Data"), tr("Muscle Oxygen (SmO2)"), "COLORSMO2", QColor(0x00, 0x89, 0x77) }, // green same as moxy monitor + { tr("Data"), tr("Haemoglobin Mass (tHb)"), "COLORTHB", QColor(0xa3,0x44,0x02) }, // brown same as moxy monitor + { tr("Data"), tr("Oxygenated Haemoglobin (O2Hb)"), "CO2HB", QColor(0xd1,0x05,0x72) }, + { tr("Data"), tr("Deoxygenated Haemoglobin (HHb)"), "CHHB", QColor(0x00,0x7f,0xcc) }, + { tr("Data"), tr("Load"), "COLORLOAD", Qt::yellow }, + { tr("Data"), tr("BikeStress"), "COLORTSS", Qt::green }, + { tr("Data"), tr("Short Term Stress"), "COLORSTS", Qt::blue }, + { tr("Data"), tr("Long Term Stress"), "COLORLTS", Qt::green }, + { tr("Data"), tr("Stress Balance"), "COLORSB", QColor(180,140,140) }, + { tr("Data"), tr("Daily Stress"), "COLORDAILYSTRESS", Qt::red }, + { tr("Data"), "Bike Score (TM)", "COLORBIKESCORE", Qt::gray }, + { tr("Gui"), tr("Calendar Text"), "COLORCALENDARTEXT", Qt::gray }, + { tr("Data"), tr("Power Zone 1 Shading"), "COLORZONE1", QColor(255,0,255) }, + { tr("Data"), tr("Power Zone 2 Shading"), "COLORZONE2", QColor(42,0,255) }, + { tr("Data"), tr("Power Zone 3 Shading"), "COLORZONE3", QColor(0,170,255) }, + { tr("Data"), tr("Power Zone 4 Shading"), "COLORZONE4", QColor(0,255,128) }, + { tr("Data"), tr("Power Zone 5 Shading"), "COLORZONE5", QColor(85,255,0) }, + { tr("Data"), tr("Power Zone 6 Shading"), "COLORZONE6", QColor(255,213,0) }, + { tr("Data"), tr("Power Zone 7 Shading"), "COLORZONE7", QColor(255,0,0) }, + { tr("Data"), tr("Power Zone 8 Shading"), "COLORZONE8", Qt::gray }, + { tr("Data"), tr("Power Zone 9 Shading"), "COLORZONE9", Qt::gray }, + { tr("Data"), tr("Power Zone 10 Shading"), "COLORZONE10", Qt::gray }, + { tr("Data"), tr("HR Zone 1 Shading"), "HRCOLORZONE1", QColor(255,0,255) }, + { tr("Data"), tr("HR Zone 2 Shading"), "HRCOLORZONE2", QColor(42,0,255) }, + { tr("Data"), tr("HR Zone 3 Shading"), "HRCOLORZONE3", QColor(0,170,255) }, + { tr("Data"), tr("HR Zone 4 Shading"), "HRCOLORZONE4", QColor(0,255,128) }, + { tr("Data"), tr("HR Zone 5 Shading"), "HRCOLORZONE5", QColor(85,255,0) }, + { tr("Data"), tr("HR Zone 6 Shading"), "HRCOLORZONE6", QColor(255,213,0) }, + { tr("Data"), tr("HR Zone 7 Shading"), "HRCOLORZONE7", QColor(255,0,0) }, + { tr("Data"), tr("HR Zone 8 Shading"), "HRCOLORZONE8", Qt::gray }, + { tr("Data"), tr("HR Zone 9 Shading"), "HRCOLORZONE9", Qt::gray }, + { tr("Data"), tr("HR Zone 10 Shading"), "HRCOLORZONE10", Qt::gray }, + { tr("Data"), tr("Aerolab Vrtual Elevation"), "COLORAEROVE", Qt::blue }, + { tr("Data"), tr("Aerolab Elevation"), "COLORAEROEL", Qt::green }, + { tr("Gui"), tr("Calendar background"), "CCALCELL", Qt::white }, + { tr("Gui"), tr("Calendar heading"), "CCALHEAD", QColor(230,230,230) }, + { tr("Gui"), tr("Calendar Current Selection"), "CCALCURRENT", QColor(255,213,0) }, + { tr("Gui"), tr("Calendar Actual Workout"), "CCALACTUAL", Qt::green }, + { tr("Gui"), tr("Calendar Planned Workout"), "CCALPLANNED", Qt::yellow }, + { tr("Gui"), tr("Calendar Today"), "CCALTODAY", Qt::cyan }, + { tr("Gui"), tr("Pop Up Windows Background"), "CPOPUP", Qt::lightGray }, + { tr("Gui"), tr("Pop Up Windows Foreground"), "CPOPUPTEXT", Qt::white }, + { tr("Gui"), tr("Chart Bar Unselected"), "CTILEBAR", Qt::gray }, + { tr("Gui"), tr("Chart Bar Selected"), "CTILEBARSELECT", Qt::yellow }, + { tr("Gui"), tr("ToolBar Background"), "CTOOLBAR", Qt::white }, + { tr("Gui"), tr("Activity History Group"), "CRIDEGROUP", QColor(236,246,255) }, + { tr("Data"), tr("SpinScan Left"), "CSPINSCANLEFT", Qt::gray }, + { tr("Data"), tr("SpinScan Right"), "CSPINSCANRIGHT", Qt::cyan }, + { tr("Data"), tr("Temperature"), "COLORTEMPERATURE", Qt::yellow }, + { tr("Data"), tr("Default Dial Color"), "CDIAL", Qt::gray }, + { tr("Data"), tr("Alternate Power"), "CALTPOWER", Qt::magenta }, + { tr("Data"), tr("Left Balance"), "CBALANCELEFT", QColor(178,0,0) }, + { tr("Data"), tr("Right Balance"), "CBALANCERIGHT", QColor(128,0,50) }, + { tr("Data"), tr("W' Balance"), "CWBAL", Qt::red }, + { tr("Data"), tr("Mean-maximal Power"), "CRIDECP", Qt::red }, + { tr("Data"), tr("Aerobic TISS"), "CATISS", Qt::magenta }, + { tr("Data"), tr("Anaerobic TISS"), "CANTISS", Qt::cyan }, + { tr("Data"), tr("Left Torque Effectiveness"), "CLTE", Qt::cyan }, + { tr("Data"), tr("Right Torque Effectiveness"), "CRTE", Qt::magenta }, + { tr("Data"), tr("Left Pedal Smoothness"), "CLPS", Qt::cyan }, + { tr("Data"), tr("Right Pedal Smoothness"), "CRPS", Qt::magenta }, #ifdef GC_HAVE_DWM - { tr("Toolbar and Sidebar"), "CCHROME", QColor(1,1,1) }, + { tr("Gui"), tr("Toolbar and Sidebar"), "CCHROME", QColor(1,1,1) }, #else #ifdef Q_OS_MAC - { tr("Toolbar and Sidebar"), "CCHROME", QColor(213,213,213) }, + { tr("Gui"), tr("Toolbar and Sidebar"), "CCHROME", QColor(213,213,213) }, #else - { tr("Sidebar background"), "CCHROME", QColor(0xec,0xec,0xec) }, + { tr("Gui"), tr("Sidebar background"), "CCHROME", QColor(0xec,0xec,0xec) }, #endif #endif - { tr("Overview Background"), "COVERVIEWBACKGROUND", QColor(0,0,0) }, - { tr("Overview Card Background"), "CCARDBACKGROUND", QColor(52,52,52) }, - { tr("VO2"), "CVO2", Qt::magenta }, - { tr("Ventilation"), "CVENTILATION", Qt::cyan }, - { tr("VCO2"), "CVCO2", Qt::green }, - { tr("Tidal Volume"), "CTIDALVOLUME", Qt::yellow }, - { tr("Respiratory Frequency"), "CRESPFREQUENCY", Qt::yellow }, - { tr("FeO2"), "CFEO2", Qt::yellow }, - { tr("Toolbar Hover"), "CHOVER", Qt::lightGray }, - { tr("Chartbar background"), "CCHARTBAR", Qt::lightGray }, - { "", "", QColor(0,0,0) }, + { tr("Gui"), tr("Overview Background"), "COVERVIEWBACKGROUND", QColor(0,0,0) }, + { tr("Gui"), tr("Overview Card Background"), "CCARDBACKGROUND", QColor(52,52,52) }, + { tr("Data"), tr("VO2"), "CVO2", Qt::magenta }, + { tr("Data"), tr("Ventilation"), "CVENTILATION", Qt::cyan }, + { tr("Data"), tr("VCO2"), "CVCO2", Qt::green }, + { tr("Data"), tr("Tidal Volume"), "CTIDALVOLUME", Qt::yellow }, + { tr("Data"), tr("Respiratory Frequency"), "CRESPFREQUENCY", Qt::yellow }, + { tr("Data"), tr("FeO2"), "CFEO2", Qt::yellow }, + { tr("Gui"), tr("Toolbar Hover"), "CHOVER", Qt::lightGray }, + { tr("Gui"), tr("Chartbar background"), "CCHARTBAR", Qt::lightGray }, + { "", "", "", QColor(0,0,0) }, }; // set the defaults to system defaults diff --git a/src/Gui/Colors.h b/src/Gui/Colors.h index ef88a3ed8..1d72c6da9 100644 --- a/src/Gui/Colors.h +++ b/src/Gui/Colors.h @@ -75,7 +75,8 @@ class Colors { public: static unsigned long fingerprint(const Colors*set); - QString name, + QString group, + name, setting; QColor color; };