mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-24 18:26:11 +03:00
parent
9d0fa213be
commit
a7f7c5fb73
2 changed files with 10 additions and 3 deletions
|
@ -195,10 +195,8 @@ void PiecesBar::paintEvent(QPaintEvent *)
|
||||||
|
|
||||||
if (!m_highlightedRegion.isNull())
|
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)};
|
QRect targetHighlightRect {m_highlightedRegion.adjusted(borderWidth, borderWidth, borderWidth, height() - 2 * borderWidth)};
|
||||||
painter.fillRect(targetHighlightRect, highlightColor);
|
painter.fillRect(targetHighlightRect, highlightedPieceColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
QPainterPath border;
|
QPainterPath border;
|
||||||
|
@ -231,6 +229,13 @@ QColor PiecesBar::pieceColor() const
|
||||||
return palette().color(QPalette::Active, QPalette::Highlight);
|
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
|
QColor PiecesBar::colorBoxBorderColor() const
|
||||||
{
|
{
|
||||||
return palette().color(QPalette::Active, QPalette::ToolTipText);
|
return palette().color(QPalette::Active, QPalette::ToolTipText);
|
||||||
|
|
|
@ -68,7 +68,9 @@ protected:
|
||||||
QColor backgroundColor() const;
|
QColor backgroundColor() const;
|
||||||
QColor borderColor() const;
|
QColor borderColor() const;
|
||||||
QColor pieceColor() const;
|
QColor pieceColor() const;
|
||||||
|
QColor highlightedPieceColor() const;
|
||||||
QColor colorBoxBorderColor() const;
|
QColor colorBoxBorderColor() const;
|
||||||
|
|
||||||
const QList<QRgb> &pieceColors() const;
|
const QList<QRgb> &pieceColors() const;
|
||||||
|
|
||||||
// mix two colors by light model, ratio <0, 1>
|
// mix two colors by light model, ratio <0, 1>
|
||||||
|
|
Loading…
Reference in a new issue