aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-07 08:47:59 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-07 08:51:54 -0800
commitd276f9cb0842967a8eede76b18acd861e635e472 (patch)
tree54f48ae517ac2e2ce5b1f506c1b9ec4cb48f2c2d /qt-ui/profile
parent8f9a20a908c0bd7bfdf6e539ea3fe83a6a83cd06 (diff)
downloadsubsurface-d276f9cb0842967a8eede76b18acd861e635e472.tar.gz
Don't show a setpoint switch event at t=0
When using that to indicate the dive type at the start of the dive, it's visually strange to have an event marker. See #826 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r--qt-ui/profile/diveeventitem.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/qt-ui/profile/diveeventitem.cpp b/qt-ui/profile/diveeventitem.cpp
index 2ec842179..a966d6a5b 100644
--- a/qt-ui/profile/diveeventitem.cpp
+++ b/qt-ui/profile/diveeventitem.cpp
@@ -66,14 +66,15 @@ void DiveEventItem::setupPixmap()
setPixmap(EVENT_PIXMAP(":warning"));
} else if (internalEvent->type == SAMPLE_EVENT_BOOKMARK) {
setPixmap(EVENT_PIXMAP(":flag"));
- } else if (strcmp(internalEvent->name, "heading") == 0) {
- // some dive computers have heading in every sample...
- // set an "almost invisible" pixmap
- // so we get the tooltip but not the clutter
- // create a narrow but somewhat tall, basically transparent pixmap
+ } else if (strcmp(internalEvent->name, "heading") == 0 ||
+ (same_string(internalEvent->name, "SP change") && internalEvent->time.seconds == 0)) {
+ // 2 cases:
+ // a) some dive computers have heading in every sample
+ // b) at t=0 we might have an "SP change" to indicate dive type
+ // in both cases we want to get the right data into the tooltip but don't want the visual clutter
+ // so set an "almost invisible" pixmap (a narrow but somewhat tall, basically transparent pixmap)
// that allows tooltips to work when we don't want to show a specific
// pixmap for an event, but want to show the event value in the tooltip
- // (e.g. if there is heading data in every sample)
QPixmap transparentPixmap(4, 20);
transparentPixmap.fill(QColor::fromRgbF(1.0, 1.0, 1.0, 0.01));
setPixmap(transparentPixmap);