Skip to content

Commit 938d8ed

Browse files
committed
set selection color from project file
fix #3400 also remove duplicate setting of background color (it is set by ProjectProperties) (cherry-picked from 07db984)
1 parent d028258 commit 938d8ed

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/app/qgisapp.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -4009,6 +4009,11 @@ bool QgisApp::addProject( QString projectFile )
40094009
QColor myColor = QColor( myRedInt, myGreenInt, myBlueInt );
40104010
mMapCanvas->setCanvasColor( myColor ); //this is fill color before rendering starts
40114011
QgsDebugMsg( "Canvas background color restored..." );
4012+
myRedInt = QgsProject::instance()->readNumEntry( "Gui", "/SelectionColorRedPart", 255 );
4013+
myGreenInt = QgsProject::instance()->readNumEntry( "Gui", "/SelectionColorGreenPart", 255 );
4014+
myBlueInt = QgsProject::instance()->readNumEntry( "Gui", "/SelectionColorBluePart", 0 );
4015+
myColor = QColor( myRedInt, myGreenInt, myBlueInt );
4016+
mMapCanvas->setSelectionColor( myColor ); //this is selection color before rendering starts
40124017

40134018
//load project scales
40144019
bool projectScales = QgsProject::instance()->readBoolEntry( "Scales", "/useProjectScales" );
@@ -9086,12 +9091,6 @@ void QgisApp::projectProperties()
90869091
// Display the modal dialog box.
90879092
pp->exec();
90889093

9089-
int myRedInt = QgsProject::instance()->readNumEntry( "Gui", "/CanvasColorRedPart", 255 );
9090-
int myGreenInt = QgsProject::instance()->readNumEntry( "Gui", "/CanvasColorGreenPart", 255 );
9091-
int myBlueInt = QgsProject::instance()->readNumEntry( "Gui", "/CanvasColorBluePart", 255 );
9092-
QColor myColor = QColor( myRedInt, myGreenInt, myBlueInt );
9093-
mMapCanvas->setCanvasColor( myColor ); // this is fill color before rendering onto canvas
9094-
90959094
qobject_cast<QgsMeasureTool*>( mMapTools.mMeasureDist )->updateSettings();
90969095
qobject_cast<QgsMeasureTool*>( mMapTools.mMeasureArea )->updateSettings();
90979096
qobject_cast<QgsMapToolMeasureAngle*>( mMapTools.mMeasureAngle )->updateSettings();

0 commit comments

Comments
 (0)