summaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
authorGravatar Martin Měřinský <mermar@centrum.cz>2017-11-29 10:57:08 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-11-30 23:14:46 -0800
commit8ef87e618afd1ec943c0f42a852b3b393c1e2113 (patch)
treec767de27b2a78d3a85575b2c15ddecd7edcca891 /profile-widget
parent0855f6f31577789888aa6d9b955c1bc46ed34d40 (diff)
downloadsubsurface-8ef87e618afd1ec943c0f42a852b3b393c1e2113.tar.gz
Use better aliases for icons.
Icon aliases were complete mess. Some icons had alias some didn't. Named with underscores vs. hyphens vs. camelCase. Lower vs. upper case. "ICON" prefix vs. suffix vs. nothing. With vs. without filename suffix. Some didn't make sence. Eg. mapwidget-marker-gray (I can see, it's grey, but what does it represent?) Some were duplicated, eg warning vs. warning-icon. Some were name after widget, which is wrong. Do not reinvent wheel. Use widely used naming scheme close to Freedesktop Icon Naming Specification. This will enable usage of common icons from current set in the future. Thus Subsurface will fit nicely to GUI. This changes icon aliases to one, easy grep-able style. Signed-off-by: Martin Měřinský <mermar@centrum.cz>
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/diveeventitem.cpp24
-rw-r--r--profile-widget/divepixmapitem.cpp2
-rw-r--r--profile-widget/profilewidget2.cpp2
3 files changed, 14 insertions, 14 deletions
diff --git a/profile-widget/diveeventitem.cpp b/profile-widget/diveeventitem.cpp
index bb9350a2f..949c31c8c 100644
--- a/profile-widget/diveeventitem.cpp
+++ b/profile-widget/diveeventitem.cpp
@@ -81,19 +81,19 @@ void DiveEventItem::setupPixmap()
#define EVENT_PIXMAP(PIX) QPixmap(QString(PIX)).scaled(sz_pix, sz_pix, Qt::KeepAspectRatio, Qt::SmoothTransformation)
#define EVENT_PIXMAP_BIGGER(PIX) QPixmap(QString(PIX)).scaled(sz_bigger, sz_bigger, Qt::KeepAspectRatio, Qt::SmoothTransformation)
if (same_string(internalEvent->name, "")) {
- setPixmap(EVENT_PIXMAP(":warning-icon"));
+ setPixmap(EVENT_PIXMAP(":status-warning-icon"));
} else if (internalEvent->type == SAMPLE_EVENT_BOOKMARK) {
- setPixmap(EVENT_PIXMAP(":flag"));
+ setPixmap(EVENT_PIXMAP(":dive-bookmark-icon"));
} 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"));
+ setPixmap(EVENT_PIXMAP_BIGGER(":gaschange-trimix-icon"));
else if (gasmix_is_air(mix))
- setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeAir"));
+ setPixmap(EVENT_PIXMAP_BIGGER(":gaschange-air-icon"));
else if (mix->o2.permille == 1000)
- setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeOxy"));
+ setPixmap(EVENT_PIXMAP_BIGGER(":gaschange-oxygen-icon"));
else
- setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeNitrox"));
+ setPixmap(EVENT_PIXMAP_BIGGER(":gaschange-ean-icon"));
#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
@@ -114,11 +114,11 @@ void DiveEventItem::setupPixmap()
setPixmap(transparentPixmap);
#ifdef SAMPLE_FLAGS_SEVERITY_SHIFT
} else if (((internalEvent->flags & SAMPLE_FLAGS_SEVERITY_MASK) >> SAMPLE_FLAGS_SEVERITY_SHIFT) == 2) {
- setPixmap(EVENT_PIXMAP(":info-icon"));
+ setPixmap(EVENT_PIXMAP(":status-info-icon"));
} else if (((internalEvent->flags & SAMPLE_FLAGS_SEVERITY_MASK) >> SAMPLE_FLAGS_SEVERITY_SHIFT) == 3) {
- setPixmap(EVENT_PIXMAP(":warning-icon"));
+ setPixmap(EVENT_PIXMAP(":status-warning-icon"));
} else if (((internalEvent->flags & SAMPLE_FLAGS_SEVERITY_MASK) >> SAMPLE_FLAGS_SEVERITY_SHIFT) == 4) {
- setPixmap(EVENT_PIXMAP(":violation-icon"));
+ setPixmap(EVENT_PIXMAP(":status-violation-icon"));
#endif
} else if (same_string_caseinsensitive(internalEvent->name, "violation") || // generic libdivecomputer
same_string_caseinsensitive(internalEvent->name, "Safety stop violation") || // the rest are from the Uemis downloader
@@ -127,17 +127,17 @@ void DiveEventItem::setupPixmap()
same_string_caseinsensitive(internalEvent->name, "Dive time alert") ||
same_string_caseinsensitive(internalEvent->name, "Low battery alert") ||
same_string_caseinsensitive(internalEvent->name, "Speed alarm")) {
- setPixmap(EVENT_PIXMAP(":violation-icon"));
+ setPixmap(EVENT_PIXMAP(":status-violation-icon"));
} else if (same_string_caseinsensitive(internalEvent->name, "non stop time") || // generic libdivecomputer
same_string_caseinsensitive(internalEvent->name, "safety stop") ||
same_string_caseinsensitive(internalEvent->name, "safety stop (voluntary)") ||
same_string_caseinsensitive(internalEvent->name, "Tank change suggested") || // Uemis downloader
same_string_caseinsensitive(internalEvent->name, "Marker")) {
- setPixmap(EVENT_PIXMAP(":info-icon"));
+ setPixmap(EVENT_PIXMAP(":status-info-icon"));
} else {
// we should do some guessing based on the type / name of the event;
// for now they all get the warning icon
- setPixmap(EVENT_PIXMAP(":warning-icon"));
+ setPixmap(EVENT_PIXMAP(":status-warning-icon"));
}
#undef EVENT_PIXMAP
#undef EVENT_PIXMAP_BIGGER
diff --git a/profile-widget/divepixmapitem.cpp b/profile-widget/divepixmapitem.cpp
index 5caec0689..1c2f18b29 100644
--- a/profile-widget/divepixmapitem.cpp
+++ b/profile-widget/divepixmapitem.cpp
@@ -29,7 +29,7 @@ void DiveButtonItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
// paint on screen, but for now, this.
CloseButtonItem::CloseButtonItem(QObject *parent): DiveButtonItem(parent)
{
- static QPixmap p = QPixmap(":trash");
+ static QPixmap p = QPixmap(":list-remove-icon");
setPixmap(p);
setFlag(ItemIgnoresTransformations);
}
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 80276c7d1..d7b159cd0 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -86,7 +86,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent),
zoomLevel(0),
zoomFactor(1.15),
background(new DivePixmapItem()),
- backgroundFile(":poster"),
+ backgroundFile(":poster-icon"),
#ifndef SUBSURFACE_MOBILE
toolTipItem(new ToolTipItem()),
#endif