Skip to content

Commit 7796b15

Browse files
committedJan 21, 2015
Merge pull request #1839 from rduivenvoorde/identify_color_11996
fix for #11996, use user colors for rubberband instead of fixed red when...
2 parents 723f7be + c5c970e commit 7796b15

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed
 

‎src/gui/qgsidentifymenu.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,9 +579,18 @@ void QgsIdentifyMenu::handleMenuHover()
579579
QgsVectorLayer* vl = qobject_cast<QgsVectorLayer*>( result.mLayer );
580580
if ( !vl )
581581
continue;
582+
582583
QgsHighlight *hl = new QgsHighlight( mCanvas, result.mFeature.geometry(), vl );
583-
hl->setColor( QColor( 255, 0, 0 ) );
584-
hl->setWidth( 2 );
584+
QSettings settings;
585+
QColor color = QColor( settings.value( "/Map/highlight/color", QGis::DEFAULT_HIGHLIGHT_COLOR.name() ).toString() );
586+
int alpha = settings.value( "/Map/highlight/colorAlpha", QGis::DEFAULT_HIGHLIGHT_COLOR.alpha() ).toInt();
587+
double buffer = settings.value( "/Map/highlight/buffer", QGis::DEFAULT_HIGHLIGHT_BUFFER_MM ).toDouble();
588+
double minWidth = settings.value( "/Map/highlight/minWidth", QGis::DEFAULT_HIGHLIGHT_MIN_WIDTH_MM ).toDouble();
589+
hl->setColor( color ); // sets also fill with default alpha
590+
color.setAlpha( alpha );
591+
hl->setFillColor( color ); // sets fill with alpha
592+
hl->setBuffer( buffer );
593+
hl->setMinWidth( minWidth );
585594
mRubberBands.append( hl );
586595
connect( vl, SIGNAL( destroyed() ), this, SLOT( layerDestroyed() ) );
587596
}

0 commit comments

Comments
 (0)
Please sign in to comment.