Skip to content

Commit

Permalink
Merge pull request #1839 from rduivenvoorde/identify_color_11996
Browse files Browse the repository at this point in the history
fix for #11996, use user colors for rubberband instead of fixed red when...
  • Loading branch information
m-kuhn committed Jan 21, 2015
2 parents 723f7be + c5c970e commit 7796b15
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 7796b15

Please sign in to comment.