Skip to content

Commit

Permalink
improve locator titles and groups visibility (#60689)
Browse files Browse the repository at this point in the history
* improve locator titles and groups visibility

* Update qgslocatormodel.cpp
  • Loading branch information
3nids authored Feb 26, 2025
1 parent c8fe793 commit 39b1f59
Showing 1 changed file with 17 additions and 2 deletions.
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

0 comments on commit 39b1f59

Please sign in to comment.