Skip to content

Commit 0b6ee77

Browse files
author
timlinux
committedJan 12, 2006
Mapcanvas background colour is now user configureable
git-svn-id: http://svn.osgeo.org/qgis/trunk@4671 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent cefe81d commit 0b6ee77

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed
 

‎src/gui/qgisapp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5156,12 +5156,12 @@ void QgisApp::projectProperties()
51565156
{
51575157
mMapCanvas->recalculateExtents();
51585158
}
5159+
}
51595160
int myRedInt = QgsProject::instance()->readNumEntry("Gui","/CanvasColorRedPart",255);
51605161
int myGreenInt = QgsProject::instance()->readNumEntry("Gui","/CanvasColorGreenPart",255);
51615162
int myBlueInt = QgsProject::instance()->readNumEntry("Gui","/CanvasColorBluePart",255);
51625163
QColor myColor = QColor(myRedInt,myGreenInt,myBlueInt);
51635164
mMapCanvas->setCanvasColor(myColor);
5164-
}
51655165
// Set the window title.
51665166
setTitleBarText_( *this );
51675167
// delete the property sheet object

‎src/gui/qgsmapcanvas.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -563,10 +563,11 @@ void QgsMapCanvas::render(QPaintDevice * theQPaintDevice)
563563
if ( ! theQPaintDevice ) //painting to mapCanvas->pixmap
564564
{
565565
mCanvasProperties->pmCanvas->fill(mCanvasProperties->bgColor);
566-
std::cout << (QString ("R: %i G: %i B: %i for canvas background").arg(
567-
mCanvasProperties->bgColor.red(),
568-
mCanvasProperties->bgColor.red(),
569-
mCanvasProperties->bgColor.red())).toLocal8Bit().data() << std::endl;
566+
QColor myColor = mCanvasProperties->bgColor;
567+
std::cout << "Canvas background R: ";
568+
std::cout << myColor.red() << " G: ";
569+
std::cout << myColor.green() << " B: ";
570+
std::cout << myColor.blue() << std::endl;
570571
paint->begin(mCanvasProperties->pmCanvas);
571572
if (mCanvasProperties->mAntiAliasFlag)
572573
{
@@ -2745,10 +2746,16 @@ void QgsMapCanvas::setMapTool(int tool)
27452746

27462747

27472748
/** Write property of QColor bgColor. */
2748-
void QgsMapCanvas::setCanvasColor(const QColor & _newVal)
2749+
void QgsMapCanvas::setCanvasColor(const QColor & theColor)
27492750
{
2750-
mCanvasProperties->bgColor = _newVal;
2751-
setEraseColor(_newVal);
2751+
mCanvasProperties->bgColor = theColor;
2752+
setEraseColor(theColor);
2753+
QColor myColor = mCanvasProperties->bgColor;
2754+
std::cout << "Setting Canvas background R: ";
2755+
std::cout << myColor.red() << " G: ";
2756+
std::cout << myColor.green() << " B: ";
2757+
std::cout << myColor.blue() << std::endl;
2758+
27522759
} // setCanvasColor
27532760

27542761

0 commit comments

Comments
 (0)
Please sign in to comment.