summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-27 22:53:39 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-27 22:53:39 -0700
commitfbc3b5242df891af9f6123eb7779f4431e8c3584 (patch)
tree9abb8a8cb9de3f89b0bba44104320ec5b1fe113c
parentee8f7de4e7fb8183c9a34dcab8ab88b96255af8d (diff)
downloadsubsurface-fbc3b5242df891af9f6123eb7779f4431e8c3584.tar.gz
Globe: use lighter and darker flags to mark the current dive site
This may be too subtle... the current dive site now has a brighter flag than the others. I may need to make it an even bigger difference or maybe make the flag a little bigger or something... but it's a start. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--icons/flag_dark.pngbin0 -> 1499 bytes
-rw-r--r--icons/flag_light.pngbin0 -> 1420 bytes
-rw-r--r--qt-ui/globe.cpp23
-rw-r--r--qt-ui/mainwindow.cpp1
-rw-r--r--subsurface.qrc2
5 files changed, 18 insertions, 8 deletions
diff --git a/icons/flag_dark.png b/icons/flag_dark.png
new file mode 100644
index 000000000..206fcfffe
--- /dev/null
+++ b/icons/flag_dark.png
Binary files differ
diff --git a/icons/flag_light.png b/icons/flag_light.png
new file mode 100644
index 000000000..231da134d
--- /dev/null
+++ b/icons/flag_light.png
Binary files differ
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp
index 60249c852..c6e997c12 100644
--- a/qt-ui/globe.cpp
+++ b/qt-ui/globe.cpp
@@ -16,6 +16,8 @@
#include <marble/MarbleModel.h>
#include <marble/MarbleDirs.h>
#include <marble/MapThemeManager.h>
+#include <marble/GeoDataStyle.h>
+#include <marble/GeoDataIconStyle.h>
#ifdef MARBLE_SUBSURFACE_BRANCH
#include <marble/MarbleDebug.h>
@@ -188,6 +190,8 @@ void GlobeGPS::mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit unit)
void GlobeGPS::repopulateLabels()
{
+ static GeoDataStyle otherSite, currentSite;
+ static GeoDataIconStyle darkFlag(QImage(":flagDark")), lightFlag(QImage(":flagLight"));
struct dive_site *ds;
int idx;
QMap<QString, GeoDataPlacemark *> locationMap;
@@ -196,12 +200,23 @@ void GlobeGPS::repopulateLabels()
delete loadedDives;
}
loadedDives = new GeoDataDocument;
+ otherSite.setIconStyle(darkFlag);
+ currentSite.setIconStyle(lightFlag);
+ if (displayed_dive_site.uuid && dive_site_has_gps_location(&displayed_dive_site)) {
+ GeoDataPlacemark *place = new GeoDataPlacemark(displayed_dive_site.name);
+ place->setStyle(&currentSite);
+ place->setCoordinate(displayed_dive_site.longitude.udeg / 1000000.0,
+ displayed_dive_site.latitude.udeg / 1000000.0, 0, GeoDataCoordinates::Degree);
+ locationMap[QString(displayed_dive_site.name)] = place;
+ loadedDives->append(place);
+ }
for_each_dive_site(idx, ds) {
if (ds->uuid == displayed_dive_site.uuid)
continue;
if (dive_site_has_gps_location(ds)) {
GeoDataPlacemark *place = new GeoDataPlacemark(ds->name);
+ place->setStyle(&otherSite);
place->setCoordinate(ds->longitude.udeg / 1000000.0, ds->latitude.udeg / 1000000.0, 0, GeoDataCoordinates::Degree);
// don't add dive locations twice, unless they are at least 50m apart
@@ -221,14 +236,6 @@ void GlobeGPS::repopulateLabels()
loadedDives->append(place);
}
}
-
- if (displayed_dive_site.uuid && dive_site_has_gps_location(&displayed_dive_site)) {
- GeoDataPlacemark *place = new GeoDataPlacemark(displayed_dive_site.name);
- place->setCoordinate(displayed_dive_site.longitude.udeg / 1000000.0,
- displayed_dive_site.latitude.udeg / 1000000.0, 0, GeoDataCoordinates::Degree);
- locationMap[QString(displayed_dive_site.name)] = place;
- loadedDives->append(place);
- }
model()->treeModel()->addDocument(loadedDives);
struct dive_site *center = displayed_dive_site.uuid != 0 ?
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 0b8ba1f76..55ef51440 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -264,6 +264,7 @@ void MainWindow::current_dive_changed(int divenr)
}
graphics()->plotDive();
information()->updateDiveInfo();
+ globe()->reload();
}
void MainWindow::on_actionNew_triggered()
diff --git a/subsurface.qrc b/subsurface.qrc
index f6abf9063..7eff0d952 100644
--- a/subsurface.qrc
+++ b/subsurface.qrc
@@ -18,6 +18,8 @@
<file alias="gaschangeNitrox">icons/Nx_change.png</file>
<file alias="gaschangeTrimix">icons/Tmx_change.png</file>
<file alias="flag">icons/flag.png</file>
+ <file alias="flagDark">icons/flag_dark.png</file>
+ <file alias="flagLight">icons/flag_light.png</file>
<file alias="scale">icons/scale.png</file>
<file alias="ruler">icons/ruler.png</file>
<file alias="poster">icons/poster.png</file>