From ee85f6bfa79398af88b011acdef62c7c3fbb12bc Mon Sep 17 00:00:00 2001 From: bill-auger Date: Sun, 10 Nov 2019 13:21:59 -0500 Subject: [PATCH] replace hard-coded bg color of requirements failure notice with relative tint --- src/modules/welcome/checker/ResultsListWidget.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/modules/welcome/checker/ResultsListWidget.cpp b/src/modules/welcome/checker/ResultsListWidget.cpp index 9c3e3f0cd..35a3cd957 100644 --- a/src/modules/welcome/checker/ResultsListWidget.cpp +++ b/src/modules/welcome/checker/ResultsListWidget.cpp @@ -71,11 +71,14 @@ ResultsListWidget::init( const Calamares::RequirementsList& checkEntries ) allChecked = false; if ( entry.mandatory ) requirementsSatisfied = false; + ciw->setAutoFillBackground( true ); QPalette pal( ciw->palette() ); - pal.setColor( QPalette::Background, Qt::white ); + QColor bgColor = pal.window().color().value(); + int bgHue = ( entry.satisfied ) ? bgColor.hue() : ( entry.mandatory ) ? 0 : 60; + bgColor.setHsv( bgHue, 64, bgColor.value() ); + pal.setColor( QPalette::Window, bgColor ); ciw->setPalette( pal ); - } } @@ -196,7 +199,10 @@ ResultsListWidget::showDetailsDialog( const Calamares::RequirementsList& checkEn ciw->setAutoFillBackground( true ); QPalette pal( ciw->palette() ); - pal.setColor( QPalette::Background, Qt::white ); + QColor bgColor = pal.window().color().value(); + int bgHue = ( entry.satisfied ) ? bgColor.hue() : ( entry.mandatory ) ? 0 : 60; + bgColor.setHsv( bgHue, 64, bgColor.value() ); + pal.setColor( QPalette::Window, bgColor ); ciw->setPalette( pal ); }