mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
29b35ad6d8
commit
9262d8a518
5 changed files with 10 additions and 2 deletions
BIN
icons/Air_change.png
Normal file
BIN
icons/Air_change.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
BIN
icons/Nx_change.png
Normal file
BIN
icons/Nx_change.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
BIN
icons/Tmx_change.png
Normal file
BIN
icons/Tmx_change.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
|
@ -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"));
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue