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)

(cherry-picked from 07db984)
  • Loading branch information
nyalldawson committed Nov 18, 2015
1 parent d028258 commit 938d8ed257b8e18421595dadce68198b71a13cf5
Showing with 5 additions and 6 deletions.
  1. +5 −6 src/app/qgisapp.cpp
@@ -4009,6 +4009,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" );
@@ -9086,12 +9091,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 938d8ed

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