Skip to content
Permalink
Browse files

fix group background color of groups in expression builder tree

fixes #35299
  • Loading branch information
3nids authored and nyalldawson committed Mar 24, 2020
1 parent fb419b6 commit d5f3568b42fabd1d9197245d9f09b73230631138
Showing with 21 additions and 16 deletions.
  1. +21 −16 src/gui/qgsexpressionbuilderwidget.cpp
@@ -13,6 +13,22 @@
* *
***************************************************************************/

#include <QMenu>
#include <QFile>
#include <QTextStream>
#include <QDir>
#include <QInputDialog>
#include <QComboBox>
#include <QGraphicsOpacityEffect>
#include <QPropertyAnimation>
#include <QMessageBox>
#include <QVersionNumber>
#include <QDateTime>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QFileDialog>

#include "qgsexpressionbuilderwidget.h"
#include "qgslogger.h"
#include "qgsexpression.h"
@@ -33,22 +49,9 @@
#include "qgsfieldformatterregistry.h"
#include "qgsfieldformatter.h"
#include "qgsexpressionstoredialog.h"
#include "qgsgui.h"
#include "qgsnative.h"

#include <QMenu>
#include <QFile>
#include <QTextStream>
#include <QDir>
#include <QInputDialog>
#include <QComboBox>
#include <QGraphicsOpacityEffect>
#include <QPropertyAnimation>
#include <QMessageBox>
#include <QVersionNumber>
#include <QDateTime>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QFileDialog>

QgsExpressionBuilderWidget::QgsExpressionBuilderWidget( QWidget *parent )
: QWidget( parent )
@@ -589,7 +592,9 @@ void QgsExpressionBuilderWidget::registerItem( const QString &group,
//Recent group should always be last group
newgroupNode->setData( group.startsWith( QLatin1String( "Recent (" ) ) ? 2 : 1, QgsExpressionItem::CUSTOM_SORT_ROLE );
newgroupNode->appendRow( item );
newgroupNode->setBackground( QBrush( QColor( 238, 238, 238 ) ) );
bool dark = QgsGui::instance()->nativePlatformInterface()->hasDarkTheme();
QColor backgroundColor = !dark ? QColor( 238, 238, 238 ) : QColor( 40, 40, 40 );
newgroupNode->setBackground( QBrush( backgroundColor ) );
mModel->appendRow( newgroupNode );
mExpressionGroups.insert( group, newgroupNode );
}

0 comments on commit d5f3568

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