[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[E-devel] E submenu placement



So, who is working on e menus at the moment?  Am I stepping on any toes
if I commit stuff like this?

The attached patch prevents submenus from being drawn off the right side
of the screen.

Are there bigger plans for menu layout adjustment?  I see that placement
also needs to take in to account the bottom of the screen.  That isn't
fixed yet.

-- 
Kevin
Index: src/bin/e_menu.c
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_menu.c,v
retrieving revision 1.55
diff -u -r1.55 e_menu.c
--- src/bin/e_menu.c	28 Jul 2006 23:22:57 -0000	1.55
+++ src/bin/e_menu.c	5 Aug 2006 20:50:16 -0000
@@ -1813,7 +1813,12 @@
    Evas_List *l, *tmp = NULL;
    
    if (!m->parent_item) return;
-   m->cur.x = m->parent_item->menu->cur.x + m->parent_item->menu->cur.w;
+   
+   /* right placement */
+   if(m->parent_item->menu->cur.x + m->parent_item->menu->cur.w + m->cur.w < m->parent_item->menu->zone->w) 
+     m->cur.x = m->parent_item->menu->cur.x + m->parent_item->menu->cur.w;
+   else /* left placement */
+     m->cur.x = m->parent_item->menu->cur.x - m->cur.w;  
    m->cur.y = m->parent_item->menu->cur.y + m->parent_item->y - m->container_y;
    /* FIXME: this will suck for big menus */
    for (l = _e_active_menus; l; l = l->next)