@@ -3163,10 +3163,12 @@ void QgisApp::fileNew( bool thePromptToSaveFlag )
3163
3163
int myRed = settings.value ( " /qgis/default_selection_color_red" , 255 ).toInt ();
3164
3164
int myGreen = settings.value ( " /qgis/default_selection_color_green" , 255 ).toInt ();
3165
3165
int myBlue = settings.value ( " /qgis/default_selection_color_blue" , 0 ).toInt ();
3166
+ int myAlpha = settings.value ( " /qgis/default_selection_color_alpha" , 255 ).toInt ();
3166
3167
prj->writeEntry ( " Gui" , " /SelectionColorRedPart" , myRed );
3167
3168
prj->writeEntry ( " Gui" , " /SelectionColorGreenPart" , myGreen );
3168
3169
prj->writeEntry ( " Gui" , " /SelectionColorBluePart" , myBlue );
3169
- QgsRenderer::setSelectionColor ( QColor ( myRed, myGreen, myBlue ) );
3170
+ prj->writeEntry ( " Gui" , " /SelectionColorAlphaPart" , myAlpha );
3171
+ QgsRenderer::setSelectionColor ( QColor ( myRed, myGreen, myBlue, myAlpha ) );
3170
3172
3171
3173
// set the canvas to the default background color
3172
3174
// the default can be set in qgisoptions
@@ -3429,6 +3431,18 @@ bool QgisApp::addProject( QString projectFile )
3429
3431
mMapCanvas ->setCanvasColor ( myColor ); // this is fill color before rendering starts
3430
3432
QgsDebugMsg ( " Canvas background color restored..." );
3431
3433
3434
+ // set the color for selections
3435
+ QSettings settings;
3436
+ int defaultRed = settings.value ( " /qgis/default_selection_color_red" , 255 ).toInt ();
3437
+ int defaultGreen = settings.value ( " /qgis/default_selection_color_green" , 255 ).toInt ();
3438
+ int defaultBlue = settings.value ( " /qgis/default_selection_color_blue" , 0 ).toInt ();
3439
+ int defaultAlpha = settings.value ( " /qgis/default_selection_color_alpha" , 255 ).toInt ();
3440
+ int myRed = QgsProject::instance ()->readNumEntry ( " Gui" , " /SelectionColorRedPart" , defaultRed );
3441
+ int myGreen = QgsProject::instance ()->readNumEntry ( " Gui" , " /SelectionColorGreenPart" , defaultGreen );
3442
+ int myBlue = QgsProject::instance ()->readNumEntry ( " Gui" , " /SelectionColorGreenPart" , defaultBlue );
3443
+ int myAlpha = QgsProject::instance ()->readNumEntry ( " Gui" , " /SelectionColorAlphaPart" , defaultAlpha );
3444
+ QgsRenderer::setSelectionColor ( QColor ( myRed, myGreen, myBlue, myAlpha ) );
3445
+
3432
3446
mMapCanvas ->updateScale ();
3433
3447
QgsDebugMsg ( " Scale restored..." );
3434
3448
@@ -3437,7 +3451,6 @@ bool QgisApp::addProject( QString projectFile )
3437
3451
// specific plug-in state
3438
3452
3439
3453
// add this to the list of recently used project files
3440
- QSettings settings;
3441
3454
saveRecentProjectPath ( projectFile, settings );
3442
3455
3443
3456
QApplication::restoreOverrideCursor ();
0 commit comments