Skip to content

Commit

Permalink
Better default style for overview frame box
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jul 11, 2012
1 parent 30fe3f9 commit d53ad86
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/core/composer/qgscomposermap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
}
1 change: 1 addition & 0 deletions src/core/composer/qgscomposermap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.