From 4ae6dbea9358114f14595e3eb87727bd8ccebcb4 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Wed, 1 Dec 2021 08:31:40 +0000 Subject: [PATCH] Tweak TopN text color .. to match the same text color used in data table since it was a little dull in dark mode and hard to read. --- src/Charts/OverviewItems.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Charts/OverviewItems.cpp b/src/Charts/OverviewItems.cpp index 71a1fb14a1..16e5fb0442 100644 --- a/src/Charts/OverviewItems.cpp +++ b/src/Charts/OverviewItems.cpp @@ -3402,6 +3402,8 @@ TopNOverviewItem::itemPaint(QPainter *painter, const QStyleOptionGraphicsItem *, int width = paintarea.width() - (numrect.width() + daterect.width() + valuerect.width() + (margins * 6)); QRectF barrect = QRectF(0,10, width, 30); + // text color + QColor cnormal = (GCColor::luminance(GColor(CCARDBACKGROUND)) < 127) ? QColor(200,200,200) : QColor(70,70,70); // PAINT for (int i=0; isetPen(QColor(100,100,100)); + painter->setPen(cnormal); painter->drawText(paintarea.topLeft()+QPointF(margins, margins+(i*rowheight)+fm.ascent()), QString("%1.").arg(i+1)); // date @@ -3452,7 +3454,6 @@ TopNOverviewItem::itemPaint(QPainter *painter, const QStyleOptionGraphicsItem *, painter->fillRect(bar, markerbrush); // value - painter->setPen(QColor(100,100,100)); painter->drawText(paintarea.topLeft()+QPointF(numrect.width()+daterect.width()+fullbar.width()+(margins*4),0)+QPointF(margins, margins+(i*rowheight)+fm.ascent()), ranked[i].value); }