Skip to content

Commit d517461

Browse files
committed
Set alpha for rubber bands. Fix #8463
1 parent fc516ae commit d517461

11 files changed

Lines changed: 16 additions & 16 deletions

‎src/app/qgsmaptoollabel.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void QgsMapToolLabel::createRubberBands( )
6767
mLabelRubberBand->addPoint( QgsPoint( rect.xMaximum(), rect.yMaximum() ) );
6868
mLabelRubberBand->addPoint( QgsPoint( rect.xMaximum(), rect.yMinimum() ) );
6969
mLabelRubberBand->addPoint( QgsPoint( rect.xMinimum(), rect.yMinimum() ) );
70-
mLabelRubberBand->setColor( Qt::green );
70+
mLabelRubberBand->setColor( QColor(0,255,0, 65) );
7171
mLabelRubberBand->setWidth( 3 );
7272
mLabelRubberBand->show();
7373

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

104104
QgsGeometry* pointGeom = QgsGeometry::fromPoint( fixPoint );
105105
mFixPointRubberBand = new QgsRubberBand( mCanvas, QGis::Line );
106-
mFixPointRubberBand->setColor( Qt::blue );
106+
mFixPointRubberBand->setColor( QColor(0, 0, 255, 65) );
107107
mFixPointRubberBand->setToGeometry( pointGeom, vlayer );
108108
mFixPointRubberBand->show();
109109
delete pointGeom;

‎src/app/qgsmaptoolmeasureangle.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void QgsMapToolMeasureAngle::createRubberBand()
133133
int myRed = settings.value( "/qgis/default_measure_color_red", 180 ).toInt();
134134
int myGreen = settings.value( "/qgis/default_measure_color_green", 180 ).toInt();
135135
int myBlue = settings.value( "/qgis/default_measure_color_blue", 180 ).toInt();
136-
mRubberBand->setColor( QColor( myRed, myGreen, myBlue ) );
136+
mRubberBand->setColor( QColor( myRed, myGreen, myBlue, 65 ) );
137137
}
138138

139139
QgsPoint QgsMapToolMeasureAngle::snapPoint( const QPoint& p )

‎src/app/qgsmaptoolmovefeature.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void QgsMapToolMoveFeature::canvasPressEvent( QMouseEvent * e )
127127
}
128128

129129
mStartPointMapCoords = toMapCoordinates( e->pos() );
130-
mRubberBand->setColor( Qt::red );
130+
mRubberBand->setColor( QColor(255, 0, 0, 65) );
131131
mRubberBand->setWidth( 2 );
132132
mRubberBand->show();
133133

‎src/app/qgsmaptoolrotatefeature.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ void QgsMapToolRotateFeature::canvasPressEvent( QMouseEvent * e )
169169
}
170170
}
171171

172-
mRubberBand->setColor( Qt::red );
172+
mRubberBand->setColor( QColor(255, 0, 0, 65) );
173173
mRubberBand->setWidth( 2 );
174174
mRubberBand->show();
175175

‎src/app/qgsmaptoolrotatelabel.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ QgsRubberBand* QgsMapToolRotateLabel::createRotationPreviewBox()
198198
}
199199

200200
mRotationPreviewBox = new QgsRubberBand( mCanvas, QGis::Line );
201-
mRotationPreviewBox->setColor( Qt::blue );
201+
mRotationPreviewBox->setColor( QColor(0, 0, 255, 65));
202202
mRotationPreviewBox->setWidth( 3 );
203203
setRotationPreviewBox( mCurrentRotation - mStartRotation );
204204
return mRotationPreviewBox;

‎src/app/qgsmaptoolsimplify.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ void QgsMapToolSimplify::canvasPressEvent( QMouseEvent * e )
299299

300300
mRubberBand = new QgsRubberBand( mCanvas );
301301
mRubberBand->setToGeometry( mSelectedFeature.geometry(), 0 );
302-
mRubberBand->setColor( Qt::red );
302+
mRubberBand->setColor( QColor(255, 0, 0, 65) );
303303
mRubberBand->setWidth( 2 );
304304
mRubberBand->show();
305305
//calculate boudaries for slidebar

‎src/app/qgsmeasuretool.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void QgsMeasureTool::updateSettings()
120120
int myRed = settings.value( "/qgis/default_measure_color_red", 180 ).toInt();
121121
int myGreen = settings.value( "/qgis/default_measure_color_green", 180 ).toInt();
122122
int myBlue = settings.value( "/qgis/default_measure_color_blue", 180 ).toInt();
123-
mRubberBand->setColor( QColor( myRed, myGreen, myBlue ) );
123+
mRubberBand->setColor( QColor( myRed, myGreen, myBlue, 65 ) );
124124
mDialog->updateSettings();
125125
}
126126

‎src/app/qgsmergeattributesdialog.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ void QgsMergeAttributesDialog::createRubberBandForFeature( int featureId )
568568
//create rubber band to highlight the feature
569569
delete mSelectionRubberBand;
570570
mSelectionRubberBand = new QgsRubberBand( mMapCanvas, mVectorLayer->geometryType() == QGis::Polygon );
571-
mSelectionRubberBand->setColor( QColor( 255, 0, 0 ) );
571+
mSelectionRubberBand->setColor( QColor( 255, 0, 0, 65 ) );
572572
QgsFeature featureToSelect;
573573
mVectorLayer->getFeatures( QgsFeatureRequest().setFilterFid( featureId ).setSubsetOfAttributes( QgsAttributeList() ) ).nextFeature( featureToSelect );
574574
mSelectionRubberBand->setToGeometry( featureToSelect.geometry(), mVectorLayer );

‎src/plugins/roadgraph/shortestpathwidget.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ RgShortestPathWidget::RgShortestPathWidget( QWidget* theParent, RoadGraphPlugin
153153
connect( mClear, SIGNAL( clicked( bool ) ), this, SLOT( clear() ) );
154154

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

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

163163
mrbPath = new QgsRubberBand( mPlugin->iface()->mapCanvas(), QGis::Line );

‎src/plugins/spatialquery/qgsrubberselectid.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void QgsRubberSelectId::show()
8282

8383
void QgsRubberSelectId::setStyle()
8484
{
85-
QColor color = QColor( mColorRGB[0], mColorRGB[1], mColorRGB[2] );
85+
QColor color = QColor( mColorRGB[0], mColorRGB[1], mColorRGB[2], 65 );
8686
mRubberBand->setColor( color );
8787
mRubberBand->setWidth( mWidth );
8888
}

0 commit comments

Comments
 (0)