Skip to content
Permalink
Browse files

fix invisible text in field expression widget in dark themes

backport of #9701
  • Loading branch information
3nids committed Apr 4, 2019
1 parent ec8bfa8 commit 89aa828a6f4fe5e6346549c982a83335c158689d
Showing with 4 additions and 5 deletions.
  1. +3 −5 src/gui/qgsfieldexpressionwidget.cpp
  2. +1 −0 src/gui/qgsfieldexpressionwidget.h
@@ -70,6 +70,8 @@ QgsFieldExpressionWidget::QgsFieldExpressionWidget( QWidget *parent )
<< QgsExpressionContextUtils::projectScope( QgsProject::instance() );

mCombo->installEventFilter( this );

mComboPalette = mCombo->lineEdit()->palette();
}

void QgsFieldExpressionWidget::setExpressionDialogTitle( const QString &title )
@@ -336,7 +338,7 @@ void QgsFieldExpressionWidget::currentFieldChanged()

void QgsFieldExpressionWidget::updateLineEditStyle( const QString &expression )
{
QPalette palette = mCombo->lineEdit()->palette();
QPalette palette( mComboPalette );
if ( !isEnabled() )
{
palette.setColor( QPalette::Text, Qt::gray );
@@ -361,10 +363,6 @@ void QgsFieldExpressionWidget::updateLineEditStyle( const QString &expression )
{
palette.setColor( QPalette::Text, Qt::red );
}
else
{
palette.setColor( QPalette::Text, Qt::black );
}
}
mCombo->lineEdit()->setPalette( palette );
}
@@ -249,6 +249,7 @@ class GUI_EXPORT QgsFieldExpressionWidget : public QWidget
const QgsExpressionContextGenerator *mExpressionContextGenerator = nullptr;
QString mBackupExpression;
bool mAllowEvalErrors = false;
QPalette mComboPalette;

friend class TestQgsFieldExpressionWidget;
};

0 comments on commit 89aa828

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