Skip to content
Permalink
Browse files

fix invisible text in field expression widget in dark themes (#9709)

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

mCombo->installEventFilter( this );

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

void QgsFieldExpressionWidget::setExpressionDialogTitle( const QString &title )
@@ -337,7 +339,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 );
@@ -362,10 +364,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 1956cf3

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