Skip to content
Permalink
Browse files

Better default style for overview frame box

  • Loading branch information
mhugent committed Jul 11, 2012
1 parent 30fe3f9 commit d53ad8645fb108328277935fcb710c0526a74ff2
Showing with 16 additions and 3 deletions.
  1. +15 −3 src/core/composer/qgscomposermap.cpp
  2. +1 −0 src/core/composer/qgscomposermap.h
@@ -46,7 +46,8 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int w
mCrossLength( 3 ), mMapCanvas( 0 ), mDrawCanvasItems( true )
{
mComposition = composition;
mOverviewFrameMapSymbol = new QgsFillSymbolV2();
mOverviewFrameMapSymbol = 0;
createDefaultOverviewFrameSymbol();

//mId = mComposition->composerMapItems().size();
int maxId = -1;
@@ -93,8 +94,8 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition )
mTopGridAnnotationDirection( Horizontal ), mBottomGridAnnotationDirection( Horizontal ), mGridFrameStyle( NoGridFrame ), mGridFrameWidth( 2.0 ), mCrossLength( 3 ),
mMapCanvas( 0 ), mDrawCanvasItems( true )
{

mOverviewFrameMapSymbol = new QgsFillSymbolV2();
mOverviewFrameMapSymbol = 0;
createDefaultOverviewFrameSymbol();

//Offset
mXOffset = 0.0;
@@ -1959,3 +1960,14 @@ void QgsComposerMap::drawOverviewMapExtent( QPainter* p )
double height = intersectRect.height() / thisExtent.height() * rect().height();
p->drawRect( QRectF( x, y, width, height ) );*/
}

void QgsComposerMap::createDefaultOverviewFrameSymbol()
{
delete mOverviewFrameMapSymbol;
QgsStringMap properties;
properties.insert( "color", "255,0,0,125" );
properties.insert( "style", "solid" );
properties.insert( "style_border", "no" );
mOverviewFrameMapSymbol = QgsFillSymbolV2::createSimple( properties );
mOverviewFrameMapSymbol->setAlpha( 0.3 );
}
@@ -462,6 +462,7 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
QMap< double, double >& rightFrameEntries, QMap< double, double >& topFrameEntries, QMap< double, double >& bottomFrameEntries ) const;
void drawGridFrameBorder( QPainter* p, const QMap< double, double >& borderPos, Border border );
void drawOverviewMapExtent( QPainter* p );
void createDefaultOverviewFrameSymbol();
};

#endif

0 comments on commit d53ad86

Please sign in to comment.
You can’t perform that action at this time.