mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
@@ -195,10 +195,8 @@ void PiecesBar::paintEvent(QPaintEvent *)
|
||||
|
||||
if (!m_highlightedRegion.isNull())
|
||||
{
|
||||
QColor highlightColor {this->palette().color(QPalette::Active, QPalette::Highlight)};
|
||||
highlightColor.setAlphaF(0.35f);
|
||||
QRect targetHighlightRect {m_highlightedRegion.adjusted(borderWidth, borderWidth, borderWidth, height() - 2 * borderWidth)};
|
||||
painter.fillRect(targetHighlightRect, highlightColor);
|
||||
painter.fillRect(targetHighlightRect, highlightedPieceColor());
|
||||
}
|
||||
|
||||
QPainterPath border;
|
||||
@@ -231,6 +229,13 @@ QColor PiecesBar::pieceColor() const
|
||||
return palette().color(QPalette::Active, QPalette::Highlight);
|
||||
}
|
||||
|
||||
QColor PiecesBar::highlightedPieceColor() const
|
||||
{
|
||||
QColor col = palette().color(QPalette::Highlight).darker();
|
||||
col.setAlphaF(0.35);
|
||||
return col;
|
||||
}
|
||||
|
||||
QColor PiecesBar::colorBoxBorderColor() const
|
||||
{
|
||||
return palette().color(QPalette::Active, QPalette::ToolTipText);
|
||||
|
||||
@@ -68,7 +68,9 @@ protected:
|
||||
QColor backgroundColor() const;
|
||||
QColor borderColor() const;
|
||||
QColor pieceColor() const;
|
||||
QColor highlightedPieceColor() const;
|
||||
QColor colorBoxBorderColor() const;
|
||||
|
||||
const QList<QRgb> &pieceColors() const;
|
||||
|
||||
// mix two colors by light model, ratio <0, 1>
|
||||
|
||||
Reference in New Issue
Block a user