Skip to content

Commit

Permalink
Avoid using default QPalette to improve theme compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Dec 21, 2018
1 parent 9df3eb3 commit 657f5a4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/gui/qgsexpressionlineedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsfieldexpressionwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsstatusbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down

0 comments on commit 657f5a4

Please sign in to comment.