Skip to content

Commit

Permalink
fix for #11996, use user colors for rubberband instead of fixed red w…
Browse files Browse the repository at this point in the history
…hen in Layer selection mode
  • Loading branch information
rduivenvoorde committed Jan 19, 2015
1 parent 6166ecc commit c5c970e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/gui/qgsidentifymenu.cpp
Expand Up @@ -579,9 +579,18 @@ void QgsIdentifyMenu::handleMenuHover()
QgsVectorLayer* vl = qobject_cast<QgsVectorLayer*>( result.mLayer );
if ( !vl )
continue;

QgsHighlight *hl = new QgsHighlight( mCanvas, result.mFeature.geometry(), vl );
hl->setColor( QColor( 255, 0, 0 ) );
hl->setWidth( 2 );
QSettings settings;
QColor color = QColor( settings.value( "/Map/highlight/color", QGis::DEFAULT_HIGHLIGHT_COLOR.name() ).toString() );
int alpha = settings.value( "/Map/highlight/colorAlpha", QGis::DEFAULT_HIGHLIGHT_COLOR.alpha() ).toInt();
double buffer = settings.value( "/Map/highlight/buffer", QGis::DEFAULT_HIGHLIGHT_BUFFER_MM ).toDouble();
double minWidth = settings.value( "/Map/highlight/minWidth", QGis::DEFAULT_HIGHLIGHT_MIN_WIDTH_MM ).toDouble();
hl->setColor( color ); // sets also fill with default alpha
color.setAlpha( alpha );
hl->setFillColor( color ); // sets fill with alpha
hl->setBuffer( buffer );
hl->setMinWidth( minWidth );
mRubberBands.append( hl );
connect( vl, SIGNAL( destroyed() ), this, SLOT( layerDestroyed() ) );
}
Expand Down

0 comments on commit c5c970e

Please sign in to comment.