Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Beatify scale bar a little
git-svn-id: http://svn.osgeo.org/qgis/trunk@8131 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Feb 9, 2008
1 parent ee11a5c commit 8a4343e
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/gui/qgsquickprint.cpp
Expand Up @@ -46,6 +46,7 @@
#include <QString>
#include <QSettings>
#include <QSvgRenderer>
#include <QLinearGradient>

//other includes
#include <cmath>
Expand Down Expand Up @@ -898,8 +899,29 @@ void QgsQuickPrint::renderPrintScaleBar(QPainter * thepPainter,
int myScaleBarWidthInt = (int) myScaleBarWidth;

//now draw the bar itself in user selected color
//thepPainter->setPen( myBackgroundPen );
thepPainter->setPen( myForegroundPen );
//make a glossygradient for the background
QGradientStops myStops;
myStops << QGradientStop(0.0,QColor("#616161"));
myStops << QGradientStop(0.5,QColor("#505050"));
myStops << QGradientStop(0.6,QColor("#434343"));
myStops << QGradientStop(1.0,QColor("#656565"));
/** Delete this I think
QLinearGradient myGlossyBrush(QPointF(myOriginX,myOriginY),
QPointF(myOriginX,myOriginY + myMajorTickSize*3));
thepPainter->setBrush(myGlossyBrush);
thepPainter->drawRect(
myOriginX,
myOriginY,
myOriginX + myScaleBarWidthInt,
myOriginY + myMajorTickSize
);
*/
//draw again with the brush in the revers direction to complete teh glossiness
QLinearGradient myReverseGlossyBrush(
QPointF(myOriginX,myOriginY + myMajorTickSize*3),
QPointF(myOriginX,myOriginY));
thepPainter->setBrush(myReverseGlossyBrush);
thepPainter->drawRect(
myOriginX,
myOriginY,
Expand Down Expand Up @@ -1097,3 +1119,6 @@ QPrinter::PageSize QgsQuickPrint::stringToPageSize(QString theSize)
return QPrinter::A4;

}



0 comments on commit 8a4343e

Please sign in to comment.