Skip to content
Permalink
Browse files
Use nicer colours for zoom and select bands. Match icon colour
  • Loading branch information
NathanW2 committed Jul 1, 2014
1 parent eb81610 commit 0c08029d82c3891294ad9087703da8b4f0389c72
@@ -25,6 +25,7 @@

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


QgsMapToolSelect::QgsMapToolSelect( QgsMapCanvas* canvas )
@@ -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 );
@@ -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;
@@ -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 )
{
@@ -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;
}
@@ -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 ) );
@@ -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 );
}


@@ -21,6 +21,7 @@

#include <QMouseEvent>
#include <QRect>
#include <QColor>
#include <QCursor>
#include <QPixmap>
#include "qgslogger.h"
@@ -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() );

0 comments on commit 0c08029

Please sign in to comment.