Skip to content

Commit

Permalink
[ui] Better visual queue for non-visible layers in the tree
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn authored and nyalldawson committed Dec 12, 2018
1 parent 0a01725 commit 7fd6a20
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/layertree/qgslayertreemodel.cpp
Expand Up @@ -260,6 +260,14 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
QFont f( QgsLayerTree::isLayer( node ) ? mFontLayer : ( QgsLayerTree::isGroup( node ) ? mFontGroup : QFont() ) );
if ( index == mCurrentIndex )
f.setUnderline( true );
if ( QgsLayerTree::isLayer( node ) )
{
const QgsMapLayer *layer = QgsLayerTree::toLayer( node )->layer();
if ( ( !node->isVisible() && ( !layer || layer->isSpatial() ) ) || ( layer && !layer->isInScaleRange( mLegendMapViewScale ) ) )
{
f.setItalic( !f.italic() );
}
}
return f;
}
else if ( role == Qt::ForegroundRole )
Expand All @@ -270,7 +278,7 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
const QgsMapLayer *layer = QgsLayerTree::toLayer( node )->layer();
if ( ( !node->isVisible() && ( !layer || layer->isSpatial() ) ) || ( layer && !layer->isInScaleRange( mLegendMapViewScale ) ) )
{
brush.setColor( Qt::lightGray );
brush.setColor( Qt::gray );
}
}
return brush;
Expand Down

0 comments on commit 7fd6a20

Please sign in to comment.