Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_attach.c 


Log Message:
- add a movement tolerance to the tooltips. this is controlled by the theme.
  mouse must move this many pixels before the tooltip will disappear. (Bug 16)
- minor formatting changes

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_attach.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -3 -r1.49 -r1.50
--- ewl_attach.c        23 Aug 2007 05:26:50 -0000      1.49
+++ ewl_attach.c        17 Oct 2007 01:40:06 -0000      1.50
@@ -569,9 +569,7 @@
 
        /* make sure the display attach is our attach */
        if (!ewl_attach_tooltip || (ewl_attach_tooltip->attach != attach))
-       {
                DRETURN(DLEVEL_STABLE);
-       }
 
        if (ewl_attach_tooltip->timer)
                ecore_timer_del(ewl_attach_tooltip->timer);
@@ -623,6 +621,20 @@
        if (!ewl_attach_tooltip)
                ewl_attach_tooltip = NEW(Ewl_Attach_Tooltip, 1);
 
+       /* we only want to kill this tooltip if the move is outside 
+        * the move tolerance */
+       if (ewl_attach_tooltip && (ewl_attach_tooltip->attach == attach))
+       {
+               int amt = 0;
+
+               amt = ewl_theme_data_int_get(w, "/tooltip/tolerance");
+               if ((e->x >= (ewl_attach_tooltip->x - amt))
+                               && (e->x <= (ewl_attach_tooltip->x + amt))
+                               && (e->y >= (ewl_attach_tooltip->y - amt))
+                               && (e->y <= (ewl_attach_tooltip->y + amt)))
+                       DRETURN(DLEVEL_STABLE);
+       }
+
        ewl_attach_tooltip_detach(attach);
 
        ewl_attach_tooltip->attach = attach;
@@ -632,10 +644,7 @@
        ewl_attach_tooltip->y = e->y;
 
        delay_str = (const char *)ewl_theme_data_str_get(w, "/tooltip/delay");
-       if (delay_str)
-       {
-               delay = atof(delay_str);
-       }
+       if (delay_str) delay = atof(delay_str);
 
        ewl_attach_tooltip->timer = ecore_timer_add(delay,
                                        ewl_attach_cb_tooltip_timer, w);



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to