mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Location completer: show candidate sites on the globe
As the user scrolls through the possible completions, show them on the globe as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
44510f990b
commit
70656cddea
1 changed files with 10 additions and 0 deletions
|
@ -11,6 +11,9 @@
|
|||
#include "weightmodel.h"
|
||||
#include "divetripmodel.h"
|
||||
#include "qthelper.h"
|
||||
#ifndef NO_MARBLE
|
||||
#include "globe.h"
|
||||
#endif
|
||||
|
||||
#include <QCompleter>
|
||||
#include <QKeyEvent>
|
||||
|
@ -520,6 +523,13 @@ void LocationFilterDelegate::paint(QPainter *painter, const QStyleOptionViewItem
|
|||
free( (void*) gpsCoords);
|
||||
}
|
||||
|
||||
#ifndef NO_MARBLE
|
||||
if ((option.state & QStyle::State_HasFocus) && dive_site_has_gps_location(ds)) {
|
||||
qDebug() << "center on" << ds->name;
|
||||
MainWindow::instance()->globe()->centerOnDiveSite(ds->uuid);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (dive_site_has_gps_location(ds) && dive_site_has_gps_location(&displayed_dive_site)) {
|
||||
// so we are showing a completion and both the current dive site and the completion
|
||||
// have a GPS fix... so let's show the distance
|
||||
|
|
Loading…
Add table
Reference in a new issue