Skip to content

Commit 4e5125b

Browse files
committed
Merge pull request #2337 from stevenmizuno/fix_3400
set selection color from project file
2 parents 9556a76 + 07db984 commit 4e5125b

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

‎src/app/qgisapp.cpp‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4252,6 +4252,11 @@ bool QgisApp::addProject( const QString& projectFile )
42524252
QColor myColor = QColor( myRedInt, myGreenInt, myBlueInt );
42534253
mMapCanvas->setCanvasColor( myColor ); //this is fill color before rendering starts
42544254
QgsDebugMsg( "Canvas background color restored..." );
4255+
myRedInt = QgsProject::instance()->readNumEntry( "Gui", "/SelectionColorRedPart", 255 );
4256+
myGreenInt = QgsProject::instance()->readNumEntry( "Gui", "/SelectionColorGreenPart", 255 );
4257+
myBlueInt = QgsProject::instance()->readNumEntry( "Gui", "/SelectionColorBluePart", 0 );
4258+
myColor = QColor( myRedInt, myGreenInt, myBlueInt );
4259+
mMapCanvas->setSelectionColor( myColor ); //this is selection color before rendering starts
42554260

42564261
//load project scales
42574262
bool projectScales = QgsProject::instance()->readBoolEntry( "Scales", "/useProjectScales" );
@@ -9336,12 +9341,6 @@ void QgisApp::projectProperties()
93369341
// Display the modal dialog box.
93379342
pp->exec();
93389343

9339-
int myRedInt = QgsProject::instance()->readNumEntry( "Gui", "/CanvasColorRedPart", 255 );
9340-
int myGreenInt = QgsProject::instance()->readNumEntry( "Gui", "/CanvasColorGreenPart", 255 );
9341-
int myBlueInt = QgsProject::instance()->readNumEntry( "Gui", "/CanvasColorBluePart", 255 );
9342-
QColor myColor = QColor( myRedInt, myGreenInt, myBlueInt );
9343-
mMapCanvas->setCanvasColor( myColor ); // this is fill color before rendering onto canvas
9344-
93459344
qobject_cast<QgsMeasureTool*>( mMapTools.mMeasureDist )->updateSettings();
93469345
qobject_cast<QgsMeasureTool*>( mMapTools.mMeasureArea )->updateSettings();
93479346
qobject_cast<QgsMapToolMeasureAngle*>( mMapTools.mMeasureAngle )->updateSettings();

0 commit comments

Comments
 (0)