Create tool-tip with depth/pressure for the whole profile area

This extends on our current tooltip logic (which shows events when you
mouse over them) to show tooltips for the whole profile area.

If you mouse over an event, that is still shown in the tooltip, but
even in the absense of events, the tooltip will be active, and mousing
over the profile area will show the time, depth and pressure.

This can certainly be improved upon further, but even in this form it is
useful.

Fixes #9

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2012-11-11 13:20:32 +01:00 committed by Dirk Hohndel
parent fe4f13f184
commit 01e8984d7d
4 changed files with 84 additions and 19 deletions

View file

@ -300,13 +300,13 @@ static void show_dive_table(struct dive *dive, cairo_t *cr, double w,
static void show_dive_profile(struct dive *dive, cairo_t *cr, double w,
double h)
{
cairo_rectangle_t drawing_area = { w/20.0, h/20.0, w, h};
struct graphics_context gc = {
.printer = 1,
.cr = cr
.cr = cr,
.drawing_area = { w/20.0, h/20.0, w, h},
};
cairo_save(cr);
plot(&gc, &drawing_area, dive, SC_PRINT);
plot(&gc, dive, SC_PRINT);
cairo_restore(cr);
}