From 9e0ca23060baacf8fa82fec7f16aa28ab42fc801 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Wed, 16 Feb 2022 16:10:54 +0600 Subject: [PATCH] qt: Construct colors from floating point values --- src/qt/qt_renderercommon.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/qt/qt_renderercommon.cpp b/src/qt/qt_renderercommon.cpp index d08fe9a26..82fa78628 100644 --- a/src/qt/qt_renderercommon.cpp +++ b/src/qt/qt_renderercommon.cpp @@ -125,16 +125,17 @@ void RendererCommon::drawStatusBarIcons(QPainter* painter) #endif if (!pixmap.isNull()) { - painter->setBrush(QColor(0, 0, 0, 255)); - painter->fillRect(x, painter->device()->height() - pixmap.height() - 5, pixmap.width(), pixmap.height() + 5, QColor(0, 0, 0, 127)); + painter->setBrush(QColor::fromRgbF(0, 0, 0, 1.)); + painter->fillRect(x, painter->device()->height() - pixmap.height() - 5, pixmap.width(), pixmap.height() + 5, QColor::fromRgbF(0, 0, 0, .5)); painter->drawPixmap(x + main_window->statusBar()->layout()->spacing() / 2, painter->device()->height() - pixmap.height() - 3, pixmap); x += pixmap.width(); if (i <= main_window->statusBar()->children().count() - 3) { - painter->fillRect(x, painter->device()->height() - pixmap.height() - 5, main_window->statusBar()->layout()->spacing(), pixmap.height() + 5, QColor(0, 0, 0, 127)); + painter->fillRect(x, painter->device()->height() - pixmap.height() - 5, main_window->statusBar()->layout()->spacing(), pixmap.height() + 5, QColor::fromRgbF(0, 0, 0, .5)); x += main_window->statusBar()->layout()->spacing(); } - else painter->fillRect(x, painter->device()->height() - pixmap.height() - 4, 4, pixmap.height() + 4, QColor(0, 0, 0, 127)); + else painter->fillRect(x, painter->device()->height() - pixmap.height() - 4, 4, pixmap.height() + 4, QColor::fromRgbF(0, 0, 0, .5)); + pixheight = qMax((unsigned int)pixheight, (unsigned int)pixmap.height()); } } }