Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-3_42] improve locator titles and groups visibility #60762

Merged
merged 2 commits into from
Feb 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/core/locator/qgslocatormodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
***************************************************************************/

#include <QFont>
#include <QPalette>

#include "qgslocatormodel.h"
#include "moc_qgslocatormodel.cpp"
Expand Down Expand Up @@ -115,17 +116,31 @@ QVariant QgsLocatorModel::data( const QModelIndex &index, int role ) const
}

case Qt::FontRole:
if ( index.column() == Name && !entry.groupTitle.isEmpty() )
{
if ( index.column() == Name )
{
QFont font;
font.setItalic( true );
font.setBold( entry.type == EntryType::Filter );
font.setItalic( entry.type == EntryType::Group );
return font;
}
else
{
return QVariant();
}
break;
}

case Qt::BackgroundRole:
{
return entry.type == EntryType::Result ? QPalette().base() : QPalette().alternateBase();
}

case Qt::ForegroundRole:
{
return QPalette().text();
}


case Qt::DecorationRole:
switch ( static_cast<Column>( index.column() ) )
Expand Down
Loading