Skip to content

Commit

Permalink
Use nicer colours for zoom and select bands. Match icon colour
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Jul 1, 2014
1 parent eb81610 commit 0c08029
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/qgsmaptoolselect.cpp
Expand Up @@ -25,6 +25,7 @@

#include <QMouseEvent>
#include <QRect>
#include <QColor>


QgsMapToolSelect::QgsMapToolSelect( QgsMapCanvas* canvas )
Expand All @@ -41,6 +42,9 @@ void QgsMapToolSelect::canvasReleaseEvent( QMouseEvent * e )
return;
}
QgsRubberBand rubberBand( mCanvas, QGis::Polygon );
QColor color( 254,178,76 );
color.setAlpha( 63 );
rubberBand.setColor( color );
QRect selectRect( 0, 0, 0, 0 );
QgsMapToolSelectUtils::expandSelectRectangle( selectRect, vlayer, e->pos() );
QgsMapToolSelectUtils::setRubberBand( mCanvas, selectRect, &rubberBand );
Expand Down
3 changes: 3 additions & 0 deletions src/app/qgsmaptoolselectfreehand.cpp
Expand Up @@ -44,6 +44,9 @@ void QgsMapToolSelectFreehand::canvasPressEvent( QMouseEvent * e )
if ( mRubberBand == NULL )
{
mRubberBand = new QgsRubberBand( mCanvas, QGis::Polygon );
QColor color( 254,178,76 );
color.setAlpha( 63 );
mRubberBand->setColor( color );
}
mRubberBand->addPoint( toMapCoordinates( e->pos() ) );
mDragging = true;
Expand Down
3 changes: 3 additions & 0 deletions src/app/qgsmaptoolselectpolygon.cpp
Expand Up @@ -40,6 +40,9 @@ void QgsMapToolSelectPolygon::canvasPressEvent( QMouseEvent * e )
if ( mRubberBand == NULL )
{
mRubberBand = new QgsRubberBand( mCanvas, QGis::Polygon );
QColor color( 254,178,76 );
color.setAlpha( 63 );
mRubberBand->setColor( color );
}
if ( e->button() == Qt::LeftButton )
{
Expand Down
6 changes: 6 additions & 0 deletions src/app/qgsmaptoolselectradius.cpp
Expand Up @@ -63,6 +63,9 @@ void QgsMapToolSelectRadius::canvasMoveEvent( QMouseEvent * e )
if ( mRubberBand == NULL )
{
mRubberBand = new QgsRubberBand( mCanvas, QGis::Polygon );
QColor color( 254,178,76 );
color.setAlpha( 63 );
mRubberBand->setColor( color );
}
mDragging = true;
}
Expand All @@ -82,6 +85,9 @@ void QgsMapToolSelectRadius::canvasReleaseEvent( QMouseEvent * e )
if ( mRubberBand == NULL )
{
mRubberBand = new QgsRubberBand( mCanvas, QGis::Polygon );
QColor color( 254,178,76 );
color.setAlpha( 63 );
mRubberBand->setColor( color );
}
mRadiusCenter = toMapCoordinates( e->pos() );
QgsPoint radiusEdge = toMapCoordinates( QPoint( e->pos().x() + 1, e->pos().y() + 1 ) );
Expand Down
3 changes: 3 additions & 0 deletions src/app/qgsmaptoolselectrectangle.cpp
Expand Up @@ -43,6 +43,9 @@ void QgsMapToolSelectRectangle::canvasPressEvent( QMouseEvent *e )
Q_UNUSED( e );
mSelectRect.setRect( 0, 0, 0, 0 );
mRubberBand = new QgsRubberBand( mCanvas, QGis::Polygon );
QColor color( 254,178,76 );
color.setAlpha( 63 );
mRubberBand->setColor( color );
}


Expand Down
4 changes: 4 additions & 0 deletions src/gui/qgsmaptoolzoom.cpp
Expand Up @@ -21,6 +21,7 @@

#include <QMouseEvent>
#include <QRect>
#include <QColor>
#include <QCursor>
#include <QPixmap>
#include "qgslogger.h"
Expand Down Expand Up @@ -50,6 +51,9 @@ void QgsMapToolZoom::canvasMoveEvent( QMouseEvent * e )
mDragging = true;
delete mRubberBand;
mRubberBand = new QgsRubberBand( mCanvas, QGis::Polygon );
QColor color( Qt::blue );
color.setAlpha( 63 );
mRubberBand->setColor( color );
mZoomRect.setTopLeft( e->pos() );
}
mZoomRect.setBottomRight( e->pos() );
Expand Down

0 comments on commit 0c08029

Please sign in to comment.