mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
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>
This commit is contained in:
parent
a422957cd6
commit
c3274b0b9f
1 changed files with 10 additions and 10 deletions
|
@ -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"));
|
||||
|
|
Loading…
Add table
Reference in a new issue