diff options
author | Stefan Fuchs <sfuchs@gmx.de> | 2017-10-19 21:55:46 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-10-19 19:00:55 -0400 |
commit | c3274b0b9ff9cb3827ac867b0aaec545ebaa29a8 (patch) | |
tree | bcad01140e8b6d6891970e5a4f6c3c305a98d57f /profile-widget/diveeventitem.cpp | |
parent | a422957cd6525b9753cafacfafdf1f3eef66870d (diff) | |
download | subsurface-c3274b0b9ff9cb3827ac867b0aaec545ebaa29a8.tar.gz |
When selecting icons for events don't misinterpret a gaschange
Don't misinterpret a gaschange as "useless internal of the dive computer"
when it has a higher flag value.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'profile-widget/diveeventitem.cpp')
-rw-r--r-- | profile-widget/diveeventitem.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/profile-widget/diveeventitem.cpp b/profile-widget/diveeventitem.cpp index f81fa41fe..b939c4ff8 100644 --- a/profile-widget/diveeventitem.cpp +++ b/profile-widget/diveeventitem.cpp @@ -82,6 +82,16 @@ void DiveEventItem::setupPixmap() setPixmap(EVENT_PIXMAP(":warning-icon")); } else if (internalEvent->type == SAMPLE_EVENT_BOOKMARK) { setPixmap(EVENT_PIXMAP(":flag")); + } else if (event_is_gaschange(internalEvent)) { + struct gasmix *mix = get_gasmix_from_event(&displayed_dive, internalEvent); + if (mix->he.permille) + setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeTrimix")); + else if (gasmix_is_air(mix)) + setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeAir")); + else if (mix->o2.permille == 1000) + setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeOxy")); + else + setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeNitrox")); #ifdef SAMPLE_FLAGS_SEVERITY_SHIFT } else if ((((internalEvent->flags & SAMPLE_FLAGS_SEVERITY_MASK) >> SAMPLE_FLAGS_SEVERITY_SHIFT) == 1) || // those are useless internals of the dive computer @@ -100,16 +110,6 @@ void DiveEventItem::setupPixmap() QPixmap transparentPixmap(4, 20); transparentPixmap.fill(QColor::fromRgbF(1.0, 1.0, 1.0, 0.01)); setPixmap(transparentPixmap); - } else if (event_is_gaschange(internalEvent)) { - struct gasmix *mix = get_gasmix_from_event(&displayed_dive, internalEvent); - if (mix->he.permille) - setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeTrimix")); - else if (gasmix_is_air(mix)) - setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeAir")); - else if (mix->o2.permille == 1000) - setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeOxy")); - else - setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeNitrox")); #ifdef SAMPLE_FLAGS_SEVERITY_SHIFT } else if (((internalEvent->flags & SAMPLE_FLAGS_SEVERITY_MASK) >> SAMPLE_FLAGS_SEVERITY_SHIFT) == 2) { setPixmap(EVENT_PIXMAP(":info-icon")); |