From fbe484a615e8c39ba307b8cc4fde58538813ad37 Mon Sep 17 00:00:00 2001 From: jagannatharjun Date: Sat, 26 Sep 2020 13:51:18 +0530 Subject: [PATCH] Use toned green color for downloading pieces in Pieces bar --- src/gui/properties/downloadedpiecesbar.cpp | 11 ++++++++++- src/gui/properties/downloadedpiecesbar.h | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gui/properties/downloadedpiecesbar.cpp b/src/gui/properties/downloadedpiecesbar.cpp index 55e05a13d..90e60a153 100644 --- a/src/gui/properties/downloadedpiecesbar.cpp +++ b/src/gui/properties/downloadedpiecesbar.cpp @@ -32,9 +32,18 @@ #include +namespace +{ + QColor dlPieceColor(const QColor &pieceColor) + { + const QColor green {Qt::green}; + return QColor::fromHsl(green.hslHue(), pieceColor.hslSaturation(), pieceColor.lightness()); + } +} + DownloadedPiecesBar::DownloadedPiecesBar(QWidget *parent) : base {parent} - , m_dlPieceColor {0, 0xd0, 0} + , m_dlPieceColor {dlPieceColor(pieceColor())} { } diff --git a/src/gui/properties/downloadedpiecesbar.h b/src/gui/properties/downloadedpiecesbar.h index e0621fe0b..42f4bb96f 100644 --- a/src/gui/properties/downloadedpiecesbar.h +++ b/src/gui/properties/downloadedpiecesbar.h @@ -57,7 +57,7 @@ private: QString simpleToolTipText() const override; // incomplete piece color - QColor m_dlPieceColor; + const QColor m_dlPieceColor; // last used bitfields, uses to better resize redraw // TODO: make a diff pieces to new pieces and update only changed pixels, speedup when update > 20x faster QBitArray m_pieces;