Enlightenment CVS committal

Author  : devilhorns
Project : e_modules
Module  : tclock

Dir     : e_modules/tclock


Modified Files:
        e_mod_main.c 


Log Message:
Fix popup position code so people can stop whinning.

===================================================================
RCS file: /cvs/e/e_modules/tclock/e_mod_main.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -3 -r1.58 -r1.59
--- e_mod_main.c        26 Dec 2007 16:47:23 -0000      1.58
+++ e_mod_main.c        29 Dec 2007 23:55:01 -0000      1.59
@@ -206,6 +206,7 @@
    E_Zone *zone = NULL;
    char buf[4096];
    int x, y, w, h;
+   int gx, gy, gw, gh;
    time_t current_time;
    struct tm *local_time;
 
@@ -236,7 +237,46 @@
    evas_object_resize(inst->o_tip, w, h);
 
    e_popup_edje_bg_object_set(inst->tip, inst->o_tip);
+
    ecore_x_pointer_xy_get(zone->container->win, &x, &y);
+   e_gadcon_client_geometry_get(inst->gcc, &gx, &gy, &gw, &gh);
+   switch (inst->gcc->gadcon->orient) 
+     {
+      case E_GADCON_ORIENT_CORNER_RT:
+      case E_GADCON_ORIENT_CORNER_RB:
+      case E_GADCON_ORIENT_RIGHT:
+       x = gx - w;
+       y = gy;
+       if ((y + h) >= zone->h)
+         y = gy + gh - h;
+       break;
+      case E_GADCON_ORIENT_LEFT:
+      case E_GADCON_ORIENT_CORNER_LT:
+      case E_GADCON_ORIENT_CORNER_LB:
+       x = gx + gw;
+       y = gy;
+       if ((y + h) >= zone->h)
+         y = gy + gh - h;
+       break;
+      case E_GADCON_ORIENT_TOP:
+      case E_GADCON_ORIENT_CORNER_TL:
+      case E_GADCON_ORIENT_CORNER_TR:
+       y = gy + gh;
+       x = gx;
+       if ((x + w) >= zone->w)
+         x = gx + gw - w;
+       break;
+      case E_GADCON_ORIENT_BOTTOM:
+      case E_GADCON_ORIENT_CORNER_BL:
+      case E_GADCON_ORIENT_CORNER_BR:
+       y = gy - h;
+       x = gx;
+       if ((x + w) >= zone->w)
+         x = gx + gw - w;
+       break;
+      default:
+       break;
+     }
    e_popup_move_resize(inst->tip, x, y, w, h);
    e_popup_show(inst->tip);
 }



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to