Skip to content

Commit

Permalink
set selection color from project file
Browse files Browse the repository at this point in the history
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 938d8ed
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 938d8ed

Please sign in to comment.