Skip to content
Permalink
Browse files

Set alpha for rubber bands. Fix #8463

  • Loading branch information
NathanW2 committed Aug 12, 2013
1 parent fc516ae commit d517461360f03ae4d2935343aa83d17cec02f01f
@@ -67,7 +67,7 @@ void QgsMapToolLabel::createRubberBands( )
mLabelRubberBand->addPoint( QgsPoint( rect.xMaximum(), rect.yMaximum() ) );
mLabelRubberBand->addPoint( QgsPoint( rect.xMaximum(), rect.yMinimum() ) );
mLabelRubberBand->addPoint( QgsPoint( rect.xMinimum(), rect.yMinimum() ) );
mLabelRubberBand->setColor( Qt::green );
mLabelRubberBand->setColor( QColor(0,255,0, 65) );
mLabelRubberBand->setWidth( 3 );
mLabelRubberBand->show();

@@ -82,7 +82,7 @@ void QgsMapToolLabel::createRubberBands( )
if ( geom )
{
mFeatureRubberBand = new QgsRubberBand( mCanvas, geom->type() );
mFeatureRubberBand->setColor( Qt::red );
mFeatureRubberBand->setColor( QColor(255, 0, 0, 65) );
mFeatureRubberBand->setToGeometry( geom, vlayer );
mFeatureRubberBand->show();
}
@@ -103,7 +103,7 @@ void QgsMapToolLabel::createRubberBands( )

QgsGeometry* pointGeom = QgsGeometry::fromPoint( fixPoint );
mFixPointRubberBand = new QgsRubberBand( mCanvas, QGis::Line );
mFixPointRubberBand->setColor( Qt::blue );
mFixPointRubberBand->setColor( QColor(0, 0, 255, 65) );
mFixPointRubberBand->setToGeometry( pointGeom, vlayer );
mFixPointRubberBand->show();
delete pointGeom;
@@ -133,7 +133,7 @@ void QgsMapToolMeasureAngle::createRubberBand()
int myRed = settings.value( "/qgis/default_measure_color_red", 180 ).toInt();
int myGreen = settings.value( "/qgis/default_measure_color_green", 180 ).toInt();
int myBlue = settings.value( "/qgis/default_measure_color_blue", 180 ).toInt();
mRubberBand->setColor( QColor( myRed, myGreen, myBlue ) );
mRubberBand->setColor( QColor( myRed, myGreen, myBlue, 65 ) );
}

QgsPoint QgsMapToolMeasureAngle::snapPoint( const QPoint& p )
@@ -127,7 +127,7 @@ void QgsMapToolMoveFeature::canvasPressEvent( QMouseEvent * e )
}

mStartPointMapCoords = toMapCoordinates( e->pos() );
mRubberBand->setColor( Qt::red );
mRubberBand->setColor( QColor(255, 0, 0, 65) );
mRubberBand->setWidth( 2 );
mRubberBand->show();

@@ -169,7 +169,7 @@ void QgsMapToolRotateFeature::canvasPressEvent( QMouseEvent * e )
}
}

mRubberBand->setColor( Qt::red );
mRubberBand->setColor( QColor(255, 0, 0, 65) );
mRubberBand->setWidth( 2 );
mRubberBand->show();

@@ -198,7 +198,7 @@ QgsRubberBand* QgsMapToolRotateLabel::createRotationPreviewBox()
}

mRotationPreviewBox = new QgsRubberBand( mCanvas, QGis::Line );
mRotationPreviewBox->setColor( Qt::blue );
mRotationPreviewBox->setColor( QColor(0, 0, 255, 65));
mRotationPreviewBox->setWidth( 3 );
setRotationPreviewBox( mCurrentRotation - mStartRotation );
return mRotationPreviewBox;
@@ -299,7 +299,7 @@ void QgsMapToolSimplify::canvasPressEvent( QMouseEvent * e )

mRubberBand = new QgsRubberBand( mCanvas );
mRubberBand->setToGeometry( mSelectedFeature.geometry(), 0 );
mRubberBand->setColor( Qt::red );
mRubberBand->setColor( QColor(255, 0, 0, 65) );
mRubberBand->setWidth( 2 );
mRubberBand->show();
//calculate boudaries for slidebar
@@ -120,7 +120,7 @@ void QgsMeasureTool::updateSettings()
int myRed = settings.value( "/qgis/default_measure_color_red", 180 ).toInt();
int myGreen = settings.value( "/qgis/default_measure_color_green", 180 ).toInt();
int myBlue = settings.value( "/qgis/default_measure_color_blue", 180 ).toInt();
mRubberBand->setColor( QColor( myRed, myGreen, myBlue ) );
mRubberBand->setColor( QColor( myRed, myGreen, myBlue, 65 ) );
mDialog->updateSettings();
}

@@ -568,7 +568,7 @@ void QgsMergeAttributesDialog::createRubberBandForFeature( int featureId )
//create rubber band to highlight the feature
delete mSelectionRubberBand;
mSelectionRubberBand = new QgsRubberBand( mMapCanvas, mVectorLayer->geometryType() == QGis::Polygon );
mSelectionRubberBand->setColor( QColor( 255, 0, 0 ) );
mSelectionRubberBand->setColor( QColor( 255, 0, 0, 65 ) );
QgsFeature featureToSelect;
mVectorLayer->getFeatures( QgsFeatureRequest().setFilterFid( featureId ).setSubsetOfAttributes( QgsAttributeList() ) ).nextFeature( featureToSelect );
mSelectionRubberBand->setToGeometry( featureToSelect.geometry(), mVectorLayer );
@@ -153,11 +153,11 @@ RgShortestPathWidget::RgShortestPathWidget( QWidget* theParent, RoadGraphPlugin
connect( mClear, SIGNAL( clicked( bool ) ), this, SLOT( clear() ) );

mrbFrontPoint = new QgsRubberBand( mPlugin->iface()->mapCanvas(), QGis::Polygon );
mrbFrontPoint->setColor( Qt::green );
mrbFrontPoint->setColor( QColor(0, 255, 0, 65) );
mrbFrontPoint->setWidth( 2 );

mrbBackPoint = new QgsRubberBand( mPlugin->iface()->mapCanvas(), QGis::Polygon );
mrbBackPoint->setColor( Qt::red );
mrbBackPoint->setColor( QColor(255, 0, 0, 65) );
mrbBackPoint->setWidth( 2 );

mrbPath = new QgsRubberBand( mPlugin->iface()->mapCanvas(), QGis::Line );
@@ -82,7 +82,7 @@ void QgsRubberSelectId::show()

void QgsRubberSelectId::setStyle()
{
QColor color = QColor( mColorRGB[0], mColorRGB[1], mColorRGB[2] );
QColor color = QColor( mColorRGB[0], mColorRGB[1], mColorRGB[2], 65 );
mRubberBand->setColor( color );
mRubberBand->setWidth( mWidth );
}
@@ -71,9 +71,9 @@ checkDock::checkDock( QgisInterface* qIface, QWidget* parent )
mRBFeature2 = new QgsRubberBand( canvas );
mRBConflict = new QgsRubberBand( canvas );

mRBFeature1->setColor( "blue" );
mRBFeature2->setColor( "green" );
mRBConflict->setColor( "red" );
mRBFeature1->setColor( QColor(0, 0, 255, 65) );
mRBFeature2->setColor( QColor(0, 255, 0, 65) );
mRBConflict->setColor( QColor(255, 0, 0, 65) );

mRBFeature1->setWidth( 5 );
mRBFeature2->setWidth( 5 );

0 comments on commit d517461

Please sign in to comment.
You can’t perform that action at this time.