Changeset 81508 in vbox for trunk/src/VBox
- Timestamp:
- Oct 24, 2019 6:39:40 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationPerformanceMonitor.cpp
r81411 r81508 96 96 void setIsAreaChartAllowed(bool fIsAreaChartAllowed); 97 97 98 QColor dataSeriesColor(int iDataSeriesIndex );98 QColor dataSeriesColor(int iDataSeriesIndex, int iDark = 0); 99 99 void setDataSeriesColor(int iDataSeriesIndex, const QColor &color); 100 100 … … 125 125 void drawDoughnutChart(QPainter &painter, quint64 iMaximum, int iDataIndex, 126 126 const QRectF &chartRect, const QRectF &innerRect); 127 /** Draws a doughnut shaped shart for two data series combines. the 2nd data is added on top of 1st. */ 127 128 void drawCombinedDoughnutChart(QPainter &painter, quint64 iMaximum, 128 129 const QRectF &chartRect, const QRectF &innerRect); … … 267 268 } 268 269 269 QColor UIChart::dataSeriesColor(int iDataSeriesIndex )270 QColor UIChart::dataSeriesColor(int iDataSeriesIndex, int iDark /* = 0 */) 270 271 { 271 272 if (iDataSeriesIndex >= DATA_SERIES_SIZE) 272 273 return QColor(); 273 return m_dataSeriesColor[iDataSeriesIndex]; 274 return QColor(qMax(m_dataSeriesColor[iDataSeriesIndex].red() - iDark, 0), 275 qMax(m_dataSeriesColor[iDataSeriesIndex].green() - iDark, 0), 276 qMax(m_dataSeriesColor[iDataSeriesIndex].blue() - iDark, 0), 277 m_dataSeriesColor[iDataSeriesIndex].alpha()); 274 278 } 275 279 … … 473 477 if (!m_pMetric) 474 478 return; 475 /* First draw a doughnut shaped chart for the 1st data series */ 479 476 480 const QQueue<quint64> *data = m_pMetric->data(iDataIndex); 477 481 if (!data || data->isEmpty()) … … 514 518 painter.drawArc(innerRect, 0, 3600 * 16); 515 519 516 /* Draw a white filled circle and th at the arc for data: */520 /* Draw a white filled circle and the arc for data: */ 517 521 QPainterPath background = wholeArc(chartRect).subtracted(wholeArc(innerRect)); 518 522 painter.setPen(Qt::NoPen); … … 547 551 /* Draw a doughnut slice for the first data series: */ 548 552 float fAngle = 360.f * data->back() / (float)iMaximum; 549 painter.setBrush( m_dataSeriesColor[iDataIndex]);553 painter.setBrush(dataSeriesColor(iDataIndex, 50)); 550 554 painter.drawPath(doughnutSlice(chartRect, innerRect, 90, fAngle)); 551 555 … … 556 560 { 557 561 float fAngle2 = 360.f * data2->back() / (float)iMaximum; 558 painter.setBrush( m_dataSeriesColor[iDataIndex]);562 painter.setBrush(dataSeriesColor(iDataIndex, 50)); 559 563 painter.drawPath(doughnutSlice(chartRect, innerRect, 90 - fAngle, fAngle2)); 560 564 }
Note:
See TracChangeset
for help on using the changeset viewer.