Skip to content

Commit

Permalink
Set alpha for rubber bands. Fix #8463
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Aug 12, 2013
1 parent fc516ae commit d517461
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/app/qgsmaptoollabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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();
}
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolmeasureangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolmovefeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolrotatefeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolrotatelabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolsimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmeasuretool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmergeattributesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/roadgraph/shortestpathwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/spatialquery/qgsrubberselectid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
6 changes: 3 additions & 3 deletions src/plugins/topology/checkDock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit d517461

Please sign in to comment.