allow tooltips to better choose their orientation
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 27 Jul 2011 06:50:56 +0000 (06:50 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 27 Jul 2011 06:50:56 +0000 (06:50 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@61793 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/els_tooltip.c

index d678ccd..0599c81 100644 (file)
@@ -410,6 +410,16 @@ _elm_tooltip_reconfigure(Elm_Tooltip *tt)
         else if (ty + th >= ch - tt->pad.by) ty = ch - th - tt->pad.by;
      }
 
+   if (tx + tw > cw)
+     {
+        if (abs(tx - tw) < (tx + tw) - cw)
+          tx -= tw;
+     }
+   if (ty + th > ch)
+     {
+        if (abs(ty - th) < (ty + th) - ch)
+          ty -= th;
+     }
    evas_object_move(tt->tt_win ? : tt->tooltip, tx, ty);
    evas_object_resize(tt->tt_win ? : tt->tooltip, tw, th);
    evas_object_show(tt->tooltip);