Skip to content
Permalink
Browse files

[ui] Better visual queue for non-visible layers in the tree

  • Loading branch information
nirvn authored and nyalldawson committed Dec 12, 2018
1 parent 0a01725 commit 7fd6a205f799feed59803c8ebfcb4d81e30b832f
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/core/layertree/qgslayertreemodel.cpp
@@ -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 7fd6a20

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