mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
WKO+ Interval Markers
Rather than skip over the 'standard' interval markers because they have such verbose names we now plot the vertical marker only. This is to indicate there is an interval at a particular point to signpost to the user that they can hover over this point to get an interval summary.
This commit is contained in:
@@ -1256,26 +1256,35 @@ AllPlot::refreshIntervalMarkers()
|
||||
QRegExp wkoAuto("^(Peak *[0-9]*(s|min)|Entire workout|Find #[0-9]*) *\\([^)]*\\)$");
|
||||
if (rideItem->ride()) {
|
||||
foreach(const RideFileInterval &interval, rideItem->ride()->intervals()) {
|
||||
|
||||
bool wko = false;
|
||||
|
||||
// skip WKO autogenerated peak intervals
|
||||
if (wkoAuto.exactMatch(interval.name))
|
||||
continue;
|
||||
if (wkoAuto.exactMatch(interval.name)) wko = true;
|
||||
|
||||
QwtPlotMarker *mrk = new QwtPlotMarker;
|
||||
standard->d_mrk.append(mrk);
|
||||
mrk->attach(this);
|
||||
mrk->setLineStyle(QwtPlotMarker::VLine);
|
||||
mrk->setLabelAlignment(Qt::AlignRight | Qt::AlignTop);
|
||||
mrk->setLinePen(QPen(GColor(CPLOTMARKER), 0, Qt::DashDotLine));
|
||||
|
||||
if (wko) mrk->setLinePen(QPen(QColor(127,127,127,127), 0, Qt::DashLine));
|
||||
else mrk->setLinePen(QPen(GColor(CPLOTMARKER), 0, Qt::DashLine));
|
||||
|
||||
// put matches on second line down
|
||||
QString name(interval.name);
|
||||
if (interval.name.startsWith(tr("Match"))) name = QString("\n%1").arg(interval.name);
|
||||
|
||||
QwtText text(wanttext ? name : "");
|
||||
text.setFont(QFont("Helvetica", 10, QFont::Bold));
|
||||
if (interval.name.startsWith(tr("Match")))
|
||||
text.setColor(GColor(CWBAL));
|
||||
else
|
||||
text.setColor(GColor(CPLOTMARKER));
|
||||
QwtText text(wanttext && !wko ? name : "");
|
||||
|
||||
if (!wko) {
|
||||
text.setFont(QFont("Helvetica", 10, QFont::Bold));
|
||||
if (interval.name.startsWith(tr("Match")))
|
||||
text.setColor(GColor(CWBAL));
|
||||
else
|
||||
text.setColor(GColor(CPLOTMARKER));
|
||||
}
|
||||
|
||||
if (!bydist)
|
||||
mrk->setValue(interval.start / 60.0, 0.0);
|
||||
else
|
||||
@@ -1302,7 +1311,7 @@ AllPlot::refreshCalibrationMarkers()
|
||||
mrk->attach(this);
|
||||
mrk->setLineStyle(QwtPlotMarker::VLine);
|
||||
mrk->setLabelAlignment(Qt::AlignRight | Qt::AlignTop);
|
||||
mrk->setLinePen(QPen(GColor(CPLOTMARKER), 0, Qt::DashDotLine));
|
||||
mrk->setLinePen(QPen(GColor(CPLOTMARKER), 0, Qt::DashLine));
|
||||
QwtText text(wanttext ? ("\n\n"+calibration.name) : "");
|
||||
text.setFont(QFont("Helvetica", 9, QFont::Bold));
|
||||
text.setColor(GColor(CPLOTMARKER));
|
||||
|
||||
Reference in New Issue
Block a user