Skip to content

Commit 0c08029

Browse files
committed
Use nicer colours for zoom and select bands. Match icon colour
1 parent eb81610 commit 0c08029

6 files changed

+23
-0
lines changed

src/app/qgsmaptoolselect.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include <QMouseEvent>
2727
#include <QRect>
28+
#include <QColor>
2829

2930

3031
QgsMapToolSelect::QgsMapToolSelect( QgsMapCanvas* canvas )
@@ -41,6 +42,9 @@ void QgsMapToolSelect::canvasReleaseEvent( QMouseEvent * e )
4142
return;
4243
}
4344
QgsRubberBand rubberBand( mCanvas, QGis::Polygon );
45+
QColor color( 254,178,76 );
46+
color.setAlpha( 63 );
47+
rubberBand.setColor( color );
4448
QRect selectRect( 0, 0, 0, 0 );
4549
QgsMapToolSelectUtils::expandSelectRectangle( selectRect, vlayer, e->pos() );
4650
QgsMapToolSelectUtils::setRubberBand( mCanvas, selectRect, &rubberBand );

src/app/qgsmaptoolselectfreehand.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ void QgsMapToolSelectFreehand::canvasPressEvent( QMouseEvent * e )
4444
if ( mRubberBand == NULL )
4545
{
4646
mRubberBand = new QgsRubberBand( mCanvas, QGis::Polygon );
47+
QColor color( 254,178,76 );
48+
color.setAlpha( 63 );
49+
mRubberBand->setColor( color );
4750
}
4851
mRubberBand->addPoint( toMapCoordinates( e->pos() ) );
4952
mDragging = true;

src/app/qgsmaptoolselectpolygon.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ void QgsMapToolSelectPolygon::canvasPressEvent( QMouseEvent * e )
4040
if ( mRubberBand == NULL )
4141
{
4242
mRubberBand = new QgsRubberBand( mCanvas, QGis::Polygon );
43+
QColor color( 254,178,76 );
44+
color.setAlpha( 63 );
45+
mRubberBand->setColor( color );
4346
}
4447
if ( e->button() == Qt::LeftButton )
4548
{

src/app/qgsmaptoolselectradius.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ void QgsMapToolSelectRadius::canvasMoveEvent( QMouseEvent * e )
6363
if ( mRubberBand == NULL )
6464
{
6565
mRubberBand = new QgsRubberBand( mCanvas, QGis::Polygon );
66+
QColor color( 254,178,76 );
67+
color.setAlpha( 63 );
68+
mRubberBand->setColor( color );
6669
}
6770
mDragging = true;
6871
}
@@ -82,6 +85,9 @@ void QgsMapToolSelectRadius::canvasReleaseEvent( QMouseEvent * e )
8285
if ( mRubberBand == NULL )
8386
{
8487
mRubberBand = new QgsRubberBand( mCanvas, QGis::Polygon );
88+
QColor color( 254,178,76 );
89+
color.setAlpha( 63 );
90+
mRubberBand->setColor( color );
8591
}
8692
mRadiusCenter = toMapCoordinates( e->pos() );
8793
QgsPoint radiusEdge = toMapCoordinates( QPoint( e->pos().x() + 1, e->pos().y() + 1 ) );

src/app/qgsmaptoolselectrectangle.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ void QgsMapToolSelectRectangle::canvasPressEvent( QMouseEvent *e )
4343
Q_UNUSED( e );
4444
mSelectRect.setRect( 0, 0, 0, 0 );
4545
mRubberBand = new QgsRubberBand( mCanvas, QGis::Polygon );
46+
QColor color( 254,178,76 );
47+
color.setAlpha( 63 );
48+
mRubberBand->setColor( color );
4649
}
4750

4851

src/gui/qgsmaptoolzoom.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include <QMouseEvent>
2323
#include <QRect>
24+
#include <QColor>
2425
#include <QCursor>
2526
#include <QPixmap>
2627
#include "qgslogger.h"
@@ -50,6 +51,9 @@ void QgsMapToolZoom::canvasMoveEvent( QMouseEvent * e )
5051
mDragging = true;
5152
delete mRubberBand;
5253
mRubberBand = new QgsRubberBand( mCanvas, QGis::Polygon );
54+
QColor color( Qt::blue );
55+
color.setAlpha( 63 );
56+
mRubberBand->setColor( color );
5357
mZoomRect.setTopLeft( e->pos() );
5458
}
5559
mZoomRect.setBottomRight( e->pos() );

0 commit comments

Comments
 (0)