Skip to content

Commit

Permalink
Add better default colour and width for measure tools. Fix #10029
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Apr 23, 2014
1 parent be18a5e commit 3a726b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/app/qgsmaptoolmeasureangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ 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, 65 ) );
mRubberBand->setColor( QColor( myRed, myGreen, myBlue, 100 ) );
mRubberBand->setWidth( 3 );
}

QgsPoint QgsMapToolMeasureAngle::snapPoint( const QPoint& p )
Expand Down
9 changes: 5 additions & 4 deletions src/app/qgsmeasuretool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ void QgsMeasureTool::updateSettings()
{
QSettings settings;

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, 65 ) );
int myRed = settings.value( "/qgis/default_measure_color_red", 222 ).toInt();
int myGreen = settings.value( "/qgis/default_measure_color_green", 155 ).toInt();
int myBlue = settings.value( "/qgis/default_measure_color_blue", 67 ).toInt();
mRubberBand->setColor( QColor( myRed, myGreen, myBlue, 100 ) );
mRubberBand->setWidth( 3 );
mDialog->updateSettings();
}

Expand Down
6 changes: 3 additions & 3 deletions src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,9 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl ) :
pbnCanvasColor->setColor( QColor( myRed, myGreen, myBlue ) );

// set the default color for the measure tool
myRed = settings.value( "/qgis/default_measure_color_red", 180 ).toInt();
myGreen = settings.value( "/qgis/default_measure_color_green", 180 ).toInt();
myBlue = settings.value( "/qgis/default_measure_color_blue", 180 ).toInt();
myRed = settings.value( "/qgis/default_measure_color_red", 222 ).toInt();
myGreen = settings.value( "/qgis/default_measure_color_green", 155 ).toInt();
myBlue = settings.value( "/qgis/default_measure_color_blue", 67 ).toInt();
pbnMeasureColor->setColor( QColor( myRed, myGreen, myBlue ) );

capitaliseCheckBox->setChecked( settings.value( "/qgis/capitaliseLayerName", QVariant( false ) ).toBool() );
Expand Down

0 comments on commit 3a726b6

Please sign in to comment.