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 committed Dec 11, 2018
1 parent bec04c1 commit c21597a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/layertree/qgslayertreemodel.cpp
Original file line number Diff line number Diff line change
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 c21597a

Please sign in to comment.