Enlightenment CVS committal

Author  : handyande
Project : misc
Module  : engage

Dir     : misc/engage/src/module


Modified Files:
        tray.c 


Log Message:
OK, tray window was not being removed on shutdown (module disable etc
)Also, tray layout now works on all edges
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/module/tray.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- tray.c      16 Jun 2005 09:39:27 -0000      1.7
+++ tray.c      20 Jun 2005 14:26:52 -0000      1.8
@@ -78,6 +78,7 @@
 
    ecore_event_handler_del(eb->tray->msg_handler);
    ecore_event_handler_del(eb->tray->dst_handler);
+   ecore_x_window_del(eb->tray->win);
 }
 
 static void
@@ -169,7 +170,11 @@
    Evas_Coord w, h, c, d;
    int x, y;
    Evas_List *wins;
-   
+   E_Gadman_Edge edge;
+
+   if (!eb->gmc)
+     return;
+   edge = e_gadman_client_edge_get(eb->gmc); 
    h = eb->engage->conf->iconsize;
    if (h < 24)
      h = 24;
@@ -178,32 +183,53 @@
    if (w == 0)
      w = 1;
    
-   evas_object_resize(eb->tray->tray, w, h);
-   ecore_x_window_resize(eb->tray->win, (int) w, (int) h);
-
-   e_box_pack_options_set(eb->tray->tray,
-                         1, 1, /* fill */
-                         0, 1, /* expand */
-                         0.0, 0.0, /* align */
-                         w, h, /* min */
-                         w, h /* max */
-                         );
+   if (edge == E_GADMAN_EDGE_BOTTOM || edge == E_GADMAN_EDGE_TOP) {
+     evas_object_resize(eb->tray->tray, w, h);
+     ecore_x_window_resize(eb->tray->win, (int) w, (int) h);
+
+     e_box_pack_options_set(eb->tray->tray,
+                           1, 1, /* fill */
+                           0, 1, /* expand */
+                           0.0, 0.0, /* align */
+                           w, h, /* min */
+                           w, h /* max */
+                           );
+   } else {
+     evas_object_resize(eb->tray->tray, h, w);
+     ecore_x_window_resize(eb->tray->win, (int) h, (int) w);
+
+     e_box_pack_options_set(eb->tray->tray,
+                           1, 1, /* fill */
+                           0, 1, /* expand */
+                           0.0, 0.0, /* align */
+                           h, w, /* min */
+                           h, w /* max */
+                           );
+   }
    
    x = 0;
-   y = h - 24;
+   if (edge == E_GADMAN_EDGE_BOTTOM || edge == E_GADMAN_EDGE_RIGHT)
+     y = h - 24;
+   else
+     y = 0;
    d = 0;
-   for (wins = eb->tray->wins; wins; wins = wins->next)
-     {
-       ecore_x_window_move((Ecore_X_Window) wins->data, x, y);
-
-       d++;
-       if (d % c == 0)
-         {
-            x += 24;
-            y = h - 24;
-         }
-       else
-         y -= 24;
-         
-     }
+   for (wins = eb->tray->wins; wins; wins = wins->next) {
+     if (edge == E_GADMAN_EDGE_BOTTOM || edge == E_GADMAN_EDGE_TOP)
+       ecore_x_window_move((Ecore_X_Window) wins->data, x, y);
+     else
+       ecore_x_window_move((Ecore_X_Window) wins->data, y, x);
+
+     d++;
+     if (d % c == 0) {
+       x += 24;
+       if (edge == E_GADMAN_EDGE_BOTTOM || edge == E_GADMAN_EDGE_RIGHT)
+         y = h - 24;
+       else
+         y = 0;
+     } else
+       if (edge == E_GADMAN_EDGE_BOTTOM || edge == E_GADMAN_EDGE_RIGHT)
+         y -= 24;
+       else
+         y += 24;
+   }
 }




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to