Skip to content
Permalink
Browse files

[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 063d02c57e946636f21f38e7063141e6d945a3fa
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/app/locator/qgsinbuiltlocatorfilters.cpp
@@ -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() );
}

0 comments on commit 063d02c

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