Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[locator] Append an active tag to item text for checked/activated act…
…ions
  • Loading branch information
nirvn committed Nov 29, 2018
1 parent 39b5dab commit 063d02c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/locator/qgsinbuiltlocatorfilters.cpp
Expand Up @@ -173,7 +173,12 @@ void QgsActionLocatorFilter::searchActions( const QString &string, QWidget *pare
tooltip.replace( QStringLiteral( "" ), QString() );
searchText.replace( QStringLiteral( "..." ), QString() );
searchText.replace( QStringLiteral( "" ), QString() );
if ( searchText.trimmed().compare( tooltip.trimmed(), Qt::CaseInsensitive ) != 0 )
bool uniqueTooltip = searchText.trimmed().compare( tooltip.trimmed(), Qt::CaseInsensitive ) != 0;
if ( action->isChecked() )
{
searchText += QStringLiteral( " [%1]" ).arg( tr( "Active" ) );
}
if ( uniqueTooltip )
{
searchText += QStringLiteral( " (%1)" ).arg( tooltip.trimmed() );
}
Expand Down

0 comments on commit 063d02c

Please sign in to comment.