[welcome] Fill backgrounds of failed requirements

This commit is contained in:
Adriaan de Groot 2022-04-20 17:01:25 +02:00
parent 217e4ab4f7
commit 47016765b3

View File

@ -36,15 +36,24 @@ paintRequirement( QPainter* painter, const QStyleOptionViewItem& option, const Q
CalamaresUtils::ImageType statusImage = CalamaresUtils::StatusOk; CalamaresUtils::ImageType statusImage = CalamaresUtils::StatusOk;
painter->setPen( QColorConstants::Black ); painter->setPen( QColorConstants::Black );
if ( index.data( Calamares::RequirementsModel::Satisfied ).toBool() ) {} if ( index.data( Calamares::RequirementsModel::Satisfied ).toBool() )
{
painter->fillRect( textRect, option.palette.window().color() );
}
else else
{ {
if ( index.data( Calamares::RequirementsModel::Mandatory ).toBool() ) if ( index.data( Calamares::RequirementsModel::Mandatory ).toBool() )
{ {
QColor bgColor = option.palette.window().color();
bgColor.setHsv( 0, 64, bgColor.value() );
painter->fillRect( option.rect, bgColor );
statusImage = CalamaresUtils::StatusError; statusImage = CalamaresUtils::StatusError;
} }
else else
{ {
QColor bgColor = option.palette.window().color();
bgColor.setHsv( 60, 64, bgColor.value() );
painter->fillRect( option.rect, bgColor );
statusImage = CalamaresUtils::StatusWarning; statusImage = CalamaresUtils::StatusWarning;
} }
} }