summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-07-23 06:46:33 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-07-23 10:07:01 (GMT)
commitbaab654c79faceedddd89298d22cae5d8c1d5419 (patch)
treed6361e94132b1fb08cee27deb4c3db8a04067bf5
parent30c7eee07501688c0f32de3eeeaff63a9209e364 (diff)
Use a svg bookmark icon by default
Icon done in inkscape, somewhat similar to the oxygen bookmark icon but much simplified.
-rw-r--r--data/CMakeLists.txt1
-rw-r--r--data/svg/bookmark.svg1
-rw-r--r--src/lib/marble/StyleBuilder.cpp20
3 files changed, 18 insertions, 4 deletions
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index 6d0776b..af6f670 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -55,6 +55,7 @@ svg/sun.png
svg/moon.png
svg/glow.png
svg/track_turtle.svg
+svg/bookmark.svg
DESTINATION ${MARBLE_DATA_INSTALL_PATH}/svg)
FILE (GLOB SVG_FILES flags/*.svg)
diff --git a/data/svg/bookmark.svg b/data/svg/bookmark.svg
new file mode 100644
index 0000000..644e0f6
--- /dev/null
+++ b/data/svg/bookmark.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48.000001 48.000001" height="48" width="48"><path d="M37.45 44.597c-2.566 1.663-11.086-5.524-14.144-5.528-2.804-.004-10.617 7.265-12.795 5.498-2.374-1.926 1.83-12.25.887-15.16-.864-2.667-10.19-7.85-9.183-10.47 1.098-2.852 12.215-2.046 14.69-3.84 2.27-1.646 4.32-12.12 7.12-11.97 3.053.163 5.722 10.985 8.193 12.785 2.267 1.65 12.86.363 13.584 3.072.79 2.955-8.678 8.836-9.626 11.743-.87 2.666 3.63 12.343 1.275 13.87z" fill="#ffe680" stroke="#fc0" stroke-width="2.9999358" stroke-linejoin="round"/></svg> \ No newline at end of file
diff --git a/src/lib/marble/StyleBuilder.cpp b/src/lib/marble/StyleBuilder.cpp
index 26ada26..4080ea9 100644
--- a/src/lib/marble/StyleBuilder.cpp
+++ b/src/lib/marble/StyleBuilder.cpp
@@ -39,6 +39,11 @@ public:
const QVector< qreal >& dashPattern = QVector< qreal >(),
const QFont& font = QFont(QLatin1String("Arial")), const QColor& fontColor = Qt::black,
const QString& texturePath = QString());
+ static GeoDataStyle::Ptr createPOIStyle( const QFont &font, const QString &bitmap,
+ const QColor &textColor = Qt::black,
+ const QColor &color = QColor( 0xBE, 0xAD, 0xAD ),
+ const QColor &outline = QColor( 0xBE, 0xAD, 0xAD ).darker()
+ );
static GeoDataStyle::Ptr createOsmPOIStyle( const QFont &font, const QString &bitmap,
const QColor &textColor = Qt::black,
const QColor &color = QColor( 0xBE, 0xAD, 0xAD ),
@@ -188,11 +193,10 @@ StyleBuilder::Private::Private() :
}
}
-GeoDataStyle::Ptr StyleBuilder::Private::createOsmPOIStyle( const QFont &font, const QString &imagePath,
+GeoDataStyle::Ptr StyleBuilder::Private::createPOIStyle( const QFont &font, const QString &path,
const QColor &textColor, const QColor &color, const QColor &outline)
{
GeoDataStyle::Ptr style = createStyle(1, 0, color, outline, true, true, Qt::SolidPattern, Qt::SolidLine, Qt::RoundCap, false);
- QString const path = MarbleDirs::path( "svg/osmcarto/svg/" + imagePath + ".svg" );
style->setIconStyle( GeoDataIconStyle( path) );
auto const screen = QApplication::screens().first();
double const physicalSize = 6.0; // mm
@@ -203,6 +207,13 @@ GeoDataStyle::Ptr StyleBuilder::Private::createOsmPOIStyle( const QFont &font, c
return style;
}
+GeoDataStyle::Ptr StyleBuilder::Private::createOsmPOIStyle( const QFont &font, const QString &imagePath,
+ const QColor &textColor, const QColor &color, const QColor &outline)
+{
+ QString const path = MarbleDirs::path( "svg/osmcarto/svg/" + imagePath + ".svg" );
+ return createPOIStyle(font, path, textColor, color, outline);
+}
+
GeoDataStyle::Ptr StyleBuilder::Private::createHighwayStyle( const QString &imagePath, const QColor& color, const QColor& outlineColor,
const QFont& font, const QColor& fontColor, qreal width, qreal realWidth, Qt::PenStyle penStyle,
Qt::PenCapStyle capStyle, bool lineBackground)
@@ -456,8 +467,9 @@ void StyleBuilder::Private::initializeDefaultStyles()
QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor ));
m_defaultStyle[GeoDataFeature::Bookmark]
- = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/bookmark.png" ),
- QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor ));
+ = StyleBuilder::Private::createPOIStyle(QFont( defaultFamily, defaultSize, 50, false ),
+ MarbleDirs::path("svg/bookmark.svg"), defaultLabelColor );
+ m_defaultStyle[GeoDataFeature::Bookmark]->iconStyle().setScale(0.75);
QColor const shopColor("#ac39ac");
QColor const transportationColor("#0066ff");