Skip to content
Permalink
Browse files

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 2f6b8e7a3f1dfed871af9a7758f3020209e55d5f
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/gui/qgsdatadefinedbutton.cpp
@@ -262,6 +262,7 @@ void QgsDataDefinedButton::aboutToShowMenu()

mDefineMenu->addSeparator();

bool fieldActive = false;
if ( !mDataTypesString.isEmpty() )
{
QAction* fieldTitleAct = mDefineMenu->addAction( tr( "Attribute field" ) );
@@ -284,6 +285,7 @@ void QgsDataDefinedButton::aboutToShowMenu()
{
act->setCheckable( true );
act->setChecked( !useExpression() );
fieldActive = !useExpression();
}
}
}
@@ -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 );

1 comment on commit 2f6b8e7

@3nids

This comment has been minimized.

Copy link
Member

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

thanks!!!!

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