Skip to content

Commit

Permalink
Add icons for data defined colors
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 11, 2019
1 parent fd9bd0a commit 56b363e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions images/images.qrc
Expand Up @@ -742,6 +742,8 @@
<file>themes/default/mIconFolder24.svg</file>
<file>themes/default/mActionNewFolder.svg</file>
<file>themes/default/mIconFieldBool.svg</file>
<file>themes/default/mIconDataDefineColor.svg</file>
<file>themes/default/mIconDataDefineColorOn.svg</file>
</qresource>
<qresource prefix="/images/tips">
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Expand Down
1 change: 1 addition & 0 deletions images/themes/default/mIconDataDefineColor.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/themes/default/mIconDataDefineColorOn.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/gui/qgspropertyoverridebutton.cpp
Expand Up @@ -753,6 +753,12 @@ void QgsPropertyOverrideButton::updateGui()
{
icon = mProperty.isActive() ? QgsApplication::getThemeIcon( QStringLiteral( "/mIconDataDefineExpressionOn.svg" ) ) : QgsApplication::getThemeIcon( QStringLiteral( "/mIconDataDefineExpression.svg" ) );

QRegularExpression rx( QStringLiteral( "^project_color\\('.*'\\)$" ) );
if ( rx.match( mExpressionString ).hasMatch() )
{
icon = mProperty.isActive() ? QgsApplication::getThemeIcon( QStringLiteral( "/mIconDataDefineColorOn.svg" ) ) : QgsApplication::getThemeIcon( QStringLiteral( "/mIconDataDefineColor.svg" ) );
}

QgsExpression exp( mExpressionString );
if ( exp.hasParserError() )
{
Expand Down

0 comments on commit 56b363e

Please sign in to comment.