Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_tooltip.c 


Log Message:
Be a little more sane about tooltip placement.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_tooltip.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_tooltip.c       28 Mar 2005 07:04:29 -0000      1.3
+++ ewl_tooltip.c       19 Apr 2005 03:39:34 -0000      1.4
@@ -109,13 +109,26 @@
 
 int ewl_tooltip_focus_timer (void *data)
 {
+       int dx, dy;
+       Ewl_Embed *em;
        Ewl_Tooltip *t = data;
 
        if (t->hide)
                return FALSE;
 
-       ewl_object_position_request (EWL_OBJECT(t), t->x + EWL_TOOLTIP_OFFSET,
-                                                   t->y + EWL_TOOLTIP_OFFSET);
+       em = ewl_embed_widget_find(EWL_WIDGET(t));
+       if ((t->x + CURRENT_W(t) + EWL_TOOLTIP_OFFSET) >
+                       (CURRENT_X(em) + CURRENT_W(em)))
+               dx = t->x - CURRENT_W(t) - EWL_TOOLTIP_OFFSET;
+       else
+               dx = t->x + EWL_TOOLTIP_OFFSET;
+
+       if ((t->y + CURRENT_H(t) + EWL_TOOLTIP_OFFSET) >
+                       (CURRENT_Y(em) + CURRENT_H(em)))
+               dy = t->y - CURRENT_H(t) - EWL_TOOLTIP_OFFSET;
+       else
+               dy = t->y + EWL_TOOLTIP_OFFSET;
+       ewl_object_position_request (EWL_OBJECT(t), dx, dy);
        ewl_widget_show (EWL_WIDGET (t));
 
        t->timer = NULL;




-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to