diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2011-10-04 12:27:55 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2011-10-04 12:27:55 -0700 |
commit | 53f809ccca43354f443bb8e02621a5625eb38fde (patch) | |
tree | 00e6066c4d9ab9eaeb065aaf6752fd21e0c423cb /display.h | |
parent | b72ade0e78825dd97add4c7607c574df351abed0 (diff) | |
download | subsurface-53f809ccca43354f443bb8e02621a5625eb38fde.tar.gz |
Replace event text with small red triangle and tooltip
We draw a little red triangle (of hardcoded size - not sure if this SHOULD
scale with the size of the plot... I like it better if it doesn't) to the
left of an event.
We then maintain an array of rectangles that each circumscribe one of
those event triangles and if the mouse pointer enters one of these
rectangles then we display (after a short delay) a tooltip with the event
text.
Manually creating these rectangles, maintaining the coordinate offset,
checking if we are inside one of these rectangles and then showing a
tooltip... this all seems like there should be gtk functions to do this by
default... but if there are then I failed to find them. So instead I
manually implemented the necessary logic.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'display.h')
-rw-r--r-- | display.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -24,5 +24,6 @@ struct graphics_context { extern void plot(struct graphics_context *gc, cairo_rectangle_int_t *drawing_area, struct dive *dive); extern void set_source_rgb(struct graphics_context *gc, double r, double g, double b); +extern void attach_tooltip(int x, int y, int w, int h, const char *text); #endif |