Merge pull request #6503 from jonaski/darker

Replace use of QColor::dark and QPalette::background
This commit is contained in:
John Maguire 2020-01-05 00:30:04 +00:00 committed by GitHub
commit cfa3ea0dca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -367,12 +367,12 @@ void BlockAnalyzer::paletteChange(const QPalette&) {
b + static_cast<int>(db * y)));
{
const QColor bg = palette().color(QPalette::Background).dark(112);
const QColor bg = palette().color(QPalette::Background).darker(112);
// make a complimentary fadebar colour
// TODO(John Maguire): dark is not always correct, dumbo!
int h, s, v;
palette().color(QPalette::Background).dark(150).getHsv(&h, &s, &v);
palette().color(QPalette::Background).darker(150).getHsv(&h, &s, &v);
const QColor fg(QColor::fromHsv(h + 120, s, v));
const double dr = fg.red() - bg.red();
@ -403,7 +403,7 @@ void BlockAnalyzer::drawBackground() {
}
const QColor bg = palette().color(QPalette::Background);
const QColor bgdark = bg.dark(112);
const QColor bgdark = bg.darker(112);
background_.fill(bg);

View File

@ -331,7 +331,7 @@ void NowPlayingWidget::SetImage(const QImage& image) {
if (visible_) {
// Cache the current pixmap so we can fade between them
previous_track_ = QPixmap(size());
previous_track_.fill(palette().background().color());
previous_track_.fill(palette().window().color());
previous_track_opacity_ = 1.0;
QPainter p(&previous_track_);
DrawContents(&p);