Skip to content
Permalink
Browse files

Avoid using default QPalette to improve theme compatibility

  • Loading branch information
nirvn committed Dec 21, 2018
1 parent 9df3eb3 commit 657f5a4b505f0307af67e68a47b36a99d227f5e6
Showing with 4 additions and 4 deletions.
  1. +1 −1 src/gui/qgsexpressionlineedit.cpp
  2. +1 −1 src/gui/qgsfieldexpressionwidget.cpp
  3. +2 −2 src/gui/qgsstatusbar.cpp
@@ -199,7 +199,7 @@ void QgsExpressionLineEdit::updateLineEditStyle( const QString &expression )
if ( !mLineEdit )
return;

QPalette palette;
QPalette palette = mLineEdit->palette();
if ( !isEnabled() )
{
palette.setColor( QPalette::Text, Qt::gray );
@@ -323,7 +323,7 @@ void QgsFieldExpressionWidget::currentFieldChanged()

void QgsFieldExpressionWidget::updateLineEditStyle( const QString &expression )
{
QPalette palette;
QPalette palette = mCombo->lineEdit()->palette();
if ( !isEnabled() )
{
palette.setColor( QPalette::Text, Qt::gray );
@@ -34,10 +34,10 @@ QgsStatusBar::QgsStatusBar( QWidget *parent )
mLineEdit->setDisabled( true );
mLineEdit->setFrame( false );
mLineEdit->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum );
QPalette palette;
QPalette palette = mLineEdit->palette();
palette.setColor( QPalette::Disabled, QPalette::Text, QPalette::WindowText );
mLineEdit->setPalette( palette );
mLineEdit->setStyleSheet( QStringLiteral( "* { background-color: rgba(0, 0, 0, 0); }" ) );
mLineEdit->setStyleSheet( QStringLiteral( "* { border: 0; background-color: rgba(0, 0, 0, 0); }" ) );
mLayout->addWidget( mLineEdit, 10 );
setLayout( mLayout );
}

0 comments on commit 657f5a4

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