Skip to content
Permalink
Browse files
[ui] Better visual queue for non-visible layers in the tree
  • Loading branch information
nirvn committed Dec 11, 2018
1 parent bec04c1 commit c21597a
Showing 1 changed file with 9 additions and 1 deletion.
@@ -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 )
@@ -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;

0 comments on commit c21597a

Please sign in to comment.