From 9262d8a5187475b157dde399f84b58ee0ff8e4b5 Mon Sep 17 00:00:00 2001 From: roberto forini Date: Thu, 10 Jul 2014 10:54:05 -0700 Subject: Use different gas change icons [Dirk Hohndel: scaled PNG files and added the code to show them and to make them somewhat bigger] Signed-off-by: roberto forini Signed-off-by: Dirk Hohndel --- icons/Air_change.png | Bin 0 -> 2693 bytes icons/Nx_change.png | Bin 0 -> 2717 bytes icons/Tmx_change.png | Bin 0 -> 2725 bytes qt-ui/profile/diveeventitem.cpp | 9 +++++++-- subsurface.qrc | 3 +++ 5 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 icons/Air_change.png create mode 100644 icons/Nx_change.png create mode 100644 icons/Tmx_change.png diff --git a/icons/Air_change.png b/icons/Air_change.png new file mode 100644 index 000000000..5e15ea464 Binary files /dev/null and b/icons/Air_change.png differ diff --git a/icons/Nx_change.png b/icons/Nx_change.png new file mode 100644 index 000000000..584e31037 Binary files /dev/null and b/icons/Nx_change.png differ diff --git a/icons/Tmx_change.png b/icons/Tmx_change.png new file mode 100644 index 000000000..ce9844bac Binary files /dev/null and b/icons/Tmx_change.png differ diff --git a/qt-ui/profile/diveeventitem.cpp b/qt-ui/profile/diveeventitem.cpp index aacb0af73..55408dfdc 100644 --- a/qt-ui/profile/diveeventitem.cpp +++ b/qt-ui/profile/diveeventitem.cpp @@ -59,7 +59,7 @@ void DiveEventItem::setEvent(struct event *ev) void DiveEventItem::setupPixmap() { #define EVENT_PIXMAP(PIX) QPixmap(QString(PIX)).scaled(20, 20, Qt::KeepAspectRatio, Qt::SmoothTransformation) -#define EVENT_PIXMAP_BIGGER(PIX) QPixmap(QString(PIX)).scaled(30, 28, Qt::KeepAspectRatio, Qt::SmoothTransformation) +#define EVENT_PIXMAP_BIGGER(PIX) QPixmap(QString(PIX)).scaled(40, 38, Qt::KeepAspectRatio, Qt::SmoothTransformation) if (!internalEvent->name) { setPixmap(EVENT_PIXMAP(":warning")); } else if (internalEvent->type == SAMPLE_EVENT_BOOKMARK) { @@ -67,7 +67,12 @@ void DiveEventItem::setupPixmap() } else if (strcmp(internalEvent->name, "heading") == 0) { setPixmap(EVENT_PIXMAP(":flag")); } else if (internalEvent->type == SAMPLE_EVENT_GASCHANGE || internalEvent->type == SAMPLE_EVENT_GASCHANGE2) { - setPixmap(EVENT_PIXMAP_BIGGER(":gaschange")); + if (internalEvent->value >> 16) + setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeTrimix")); + else if (internalEvent->value == 0) + setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeAir")); + else + setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeNitrox")); } else { setPixmap(EVENT_PIXMAP(":warning")); } diff --git a/subsurface.qrc b/subsurface.qrc index 64f78a144..dfeea6819 100644 --- a/subsurface.qrc +++ b/subsurface.qrc @@ -14,6 +14,9 @@ icons/average.png icons/warning.png icons/gaschange.png + icons/Air_change.png + icons/Nx_change.png + icons/Tmx_change.png icons/flag.png icons/scale.png icons/ruler.png -- cgit v1.2.3-70-g09d2