Skip to content
Permalink
Browse files

[ui] Improve source fields properties colors to play will with any li…

…ght/gray/dark themes (#35331)
  • Loading branch information
nirvn committed Mar 25, 2020
1 parent 3d339f2 commit a9462b66a6831c3cd9756618c492b0d9e66f1b3f
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/app/qgssourcefieldsproperties.cpp
@@ -146,21 +146,25 @@ void QgsSourceFieldsProperties::attributeAdded( int idx )
setRow( row, idx, fields.at( idx ) );
mFieldsList->setCurrentCell( row, idx );

QColor expressionColor = QColor( 103, 0, 243, 44 );
QColor joinColor = QColor( 0, 243, 79, 44 );
QColor defaultColor = QColor( 252, 255, 79, 44 );

for ( int i = 0; i < mFieldsList->columnCount(); i++ )
{
switch ( mLayer->fields().fieldOrigin( idx ) )
{
case QgsFields::OriginExpression:
if ( i == 7 ) continue;
mFieldsList->item( row, i )->setBackgroundColor( QColor( 200, 200, 255 ) );
mFieldsList->item( row, i )->setBackgroundColor( expressionColor );
break;

case QgsFields::OriginJoin:
mFieldsList->item( row, i )->setBackgroundColor( QColor( 200, 255, 200 ) );
mFieldsList->item( row, i )->setBackgroundColor( joinColor );
break;

default:
mFieldsList->item( row, i )->setBackgroundColor( QColor( 255, 255, 200 ) );
mFieldsList->item( row, i )->setBackgroundColor( defaultColor );
break;
}
}

0 comments on commit a9462b6

Please sign in to comment.
You can’t perform that action at this time.