Skip to content
Permalink
Browse files

set selection color from project file

fix #3400
also remove duplicate setting of background color (it is set by ProjectProperties)
  • Loading branch information
stevenmizuno committed Sep 16, 2015
1 parent 91e1554 commit 07db9848301daae5c07b3ee5a4130cf80a357f65
Showing with 5 additions and 6 deletions.
  1. +5 −6 src/app/qgisapp.cpp
@@ -4250,6 +4250,11 @@ bool QgisApp::addProject( QString projectFile )
QColor myColor = QColor( myRedInt, myGreenInt, myBlueInt );
mMapCanvas->setCanvasColor( myColor ); //this is fill color before rendering starts
QgsDebugMsg( "Canvas background color restored..." );
myRedInt = QgsProject::instance()->readNumEntry( "Gui", "/SelectionColorRedPart", 255 );
myGreenInt = QgsProject::instance()->readNumEntry( "Gui", "/SelectionColorGreenPart", 255 );
myBlueInt = QgsProject::instance()->readNumEntry( "Gui", "/SelectionColorBluePart", 0 );
myColor = QColor( myRedInt, myGreenInt, myBlueInt );
mMapCanvas->setSelectionColor( myColor ); //this is selection color before rendering starts

//load project scales
bool projectScales = QgsProject::instance()->readBoolEntry( "Scales", "/useProjectScales" );
@@ -9330,12 +9335,6 @@ void QgisApp::projectProperties()
// Display the modal dialog box.
pp->exec();

int myRedInt = QgsProject::instance()->readNumEntry( "Gui", "/CanvasColorRedPart", 255 );
int myGreenInt = QgsProject::instance()->readNumEntry( "Gui", "/CanvasColorGreenPart", 255 );
int myBlueInt = QgsProject::instance()->readNumEntry( "Gui", "/CanvasColorBluePart", 255 );
QColor myColor = QColor( myRedInt, myGreenInt, myBlueInt );
mMapCanvas->setCanvasColor( myColor ); // this is fill color before rendering onto canvas

qobject_cast<QgsMeasureTool*>( mMapTools.mMeasureDist )->updateSettings();
qobject_cast<QgsMeasureTool*>( mMapTools.mMeasureArea )->updateSettings();
qobject_cast<QgsMapToolMeasureAngle*>( mMapTools.mMeasureAngle )->updateSettings();

0 comments on commit 07db984

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