summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar roberto forini <forini.r@gmail.com>2014-07-10 10:54:05 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-10 12:37:54 -0700
commit9262d8a5187475b157dde399f84b58ee0ff8e4b5 (patch)
treea29c6bcff9a62c835816a6ed1fd019a30cf8b303
parent29b35ad6d8e7701eb9e2b89e9b6f3b8ff987a6ca (diff)
downloadsubsurface-9262d8a5187475b157dde399f84b58ee0ff8e4b5.tar.gz
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 <forini.r@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--icons/Air_change.pngbin0 -> 2693 bytes
-rw-r--r--icons/Nx_change.pngbin0 -> 2717 bytes
-rw-r--r--icons/Tmx_change.pngbin0 -> 2725 bytes
-rw-r--r--qt-ui/profile/diveeventitem.cpp9
-rw-r--r--subsurface.qrc3
5 files changed, 10 insertions, 2 deletions
diff --git a/icons/Air_change.png b/icons/Air_change.png
new file mode 100644
index 000000000..5e15ea464
--- /dev/null
+++ b/icons/Air_change.png
Binary files differ
diff --git a/icons/Nx_change.png b/icons/Nx_change.png
new file mode 100644
index 000000000..584e31037
--- /dev/null
+++ b/icons/Nx_change.png
Binary files differ
diff --git a/icons/Tmx_change.png b/icons/Tmx_change.png
new file mode 100644
index 000000000..ce9844bac
--- /dev/null
+++ b/icons/Tmx_change.png
Binary files 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 @@
<file alias="average">icons/average.png</file>
<file alias="warning">icons/warning.png</file>
<file alias="gaschange">icons/gaschange.png</file>
+ <file alias="gaschangeAir">icons/Air_change.png</file>
+ <file alias="gaschangeNitrox">icons/Nx_change.png</file>
+ <file alias="gaschangeTrimix">icons/Tmx_change.png</file>
<file alias="flag">icons/flag.png</file>
<file alias="scale">icons/scale.png</file>
<file alias="ruler">icons/ruler.png</file>