mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Don't show a pixmap for heading event
Some dive computers appear to have heading data in every sample. In order to avoid a completely cluttered dive profile we no longer show a flag for every heading event but instead show a basically transparent pixmap (which is invisible to the user) that allows us to report the heading information in the tooltip but leaves the profile uncluttered. Fixes #586 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
87575a24c2
commit
b800530bcd
2 changed files with 11 additions and 1 deletions
|
@ -20,6 +20,12 @@ DiveEventItem::DiveEventItem(QObject *parent) : DivePixmapItem(parent),
|
||||||
internalEvent(NULL)
|
internalEvent(NULL)
|
||||||
{
|
{
|
||||||
setFlag(ItemIgnoresTransformations);
|
setFlag(ItemIgnoresTransformations);
|
||||||
|
// create a narrow but somewhat tall, basically transparent pixmap
|
||||||
|
// that allows tooltips to work when we don't want to show a specific
|
||||||
|
// pixmap for an event, but want to show the event value in the tooltip
|
||||||
|
// (e.g. if there is heading data in every sample)
|
||||||
|
transparentPixmap = new QPixmap(4, 20);
|
||||||
|
transparentPixmap->fill(QColor::fromRgbF(1.0, 1.0, 1.0, 0.01));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,7 +76,10 @@ void DiveEventItem::setupPixmap()
|
||||||
} else if (internalEvent->type == SAMPLE_EVENT_BOOKMARK) {
|
} else if (internalEvent->type == SAMPLE_EVENT_BOOKMARK) {
|
||||||
setPixmap(EVENT_PIXMAP(":flag"));
|
setPixmap(EVENT_PIXMAP(":flag"));
|
||||||
} else if (strcmp(internalEvent->name, "heading") == 0) {
|
} else if (strcmp(internalEvent->name, "heading") == 0) {
|
||||||
setPixmap(EVENT_PIXMAP(":flag"));
|
// some dive computers have heading in every sample...
|
||||||
|
// set an "almost invisible" pixmap
|
||||||
|
// so we get the tooltip but not the clutter
|
||||||
|
setPixmap(*transparentPixmap);
|
||||||
} else if (event_is_gaschange(internalEvent)) {
|
} else if (event_is_gaschange(internalEvent)) {
|
||||||
if (internalEvent->gas.mix.he.permille)
|
if (internalEvent->gas.mix.he.permille)
|
||||||
setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeTrimix"));
|
setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeTrimix"));
|
||||||
|
|
|
@ -29,6 +29,7 @@ private:
|
||||||
DiveCartesianAxis *hAxis;
|
DiveCartesianAxis *hAxis;
|
||||||
DivePlotDataModel *dataModel;
|
DivePlotDataModel *dataModel;
|
||||||
struct event *internalEvent;
|
struct event *internalEvent;
|
||||||
|
QPixmap *transparentPixmap;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIVEEVENTITEM_H
|
#endif // DIVEEVENTITEM_H
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue