Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make it more obvious if a field is selected in a data defined button
by ticking the "fields" submenu as well as the field
  • Loading branch information
nyalldawson committed May 6, 2015
1 parent ad7fad5 commit 2f6b8e7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gui/qgsdatadefinedbutton.cpp
Expand Up @@ -262,6 +262,7 @@ void QgsDataDefinedButton::aboutToShowMenu()

mDefineMenu->addSeparator();

bool fieldActive = false;
if ( !mDataTypesString.isEmpty() )
{
QAction* fieldTitleAct = mDefineMenu->addAction( tr( "Attribute field" ) );
Expand All @@ -284,6 +285,7 @@ void QgsDataDefinedButton::aboutToShowMenu()
{
act->setCheckable( true );
act->setChecked( !useExpression() );
fieldActive = !useExpression();
}
}
}
Expand All @@ -296,6 +298,9 @@ void QgsDataDefinedButton::aboutToShowMenu()
mDefineMenu->addSeparator();
}

mFieldsMenu->menuAction()->setCheckable( true );
mFieldsMenu->menuAction()->setChecked( fieldActive );

QAction* exprTitleAct = mDefineMenu->addAction( tr( "Expression" ) );
exprTitleAct->setFont( titlefont );
exprTitleAct->setEnabled( false );
Expand Down

1 comment on commit 2f6b8e7

@3nids
Copy link
Member

@3nids 3nids commented on 2f6b8e7 May 6, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!!!!

Please sign in to comment.