Re: [E-devel] e_menu patch for smarter placement

2006-09-07 Thread The Rasterman
On Sun, 13 Aug 2006 22:11:49 + Hannes Janetzek <[EMAIL PROTECTED]> babbled:

> Hello,
> 
> I made a patch for e_menu that minimizes the need for vertical
> scrolling. 
> 
> The submenu starts either above or below the actual
> Item, not only below. It works as follows: if the menu is larger than
> the screen then place the menu so that more is shown. e.g. if its start
> in the lower half of the screen more is shown when the menu is above.
> If the menu is smaller than the screen but it goes offscreen then it is
> also tested if the menu should go above.
> 
> The submenu starts of  course direct next to the actual item. The terms
> above and below could be misleading.
> 
> If this should be made an option I can change the patch, though i could
> hardly understand why someone would like it less comfortable :) 

decent enough - patch accepted :)

-- 
- Codito, ergo sum - "I code, therefore I am" --
The Rasterman (Carsten Haitzler)[EMAIL PROTECTED]
裸好多
Tokyo, Japan (東京 日本)

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] e_menu patch for smarter placement

2006-08-14 Thread Hannes Janetzek
Am Sun, 13 Aug 2006 22:11:49 +
schrieb Hannes Janetzek <[EMAIL PROTECTED]>:

> Hello,
> 
> I made a patch for e_menu that minimizes the need for vertical
> scrolling. 
> 
> The submenu starts either above or below the actual
> Item, not only below. It works as follows: if the menu is larger than
> the screen then place the menu so that more is shown. e.g. if it
> starts in the lower half of the screen more is shown when the menu is
> above. If the menu is smaller than the screen but it goes offscreen
> then it is also tested if the menu should go above.
> 
> The submenu starts of  course direct next to the actual item. The
> terms above and below could be misleading.
> 
> If this should be made an option I can change the patch, though i
> could hardly understand why someone would like it less comfortable :) 
>  
ok, I see there could also be an aesthetical reason against this
placement method.  Though it would be good if it could be set by the
application. For example the start module when it is at the bottom one
has to scroll for almost all items in "favourite applications" which
is pretty uncomfortable.

So what about a function like:
e_menu_submenu_placement_set(E_Menu *mn, int placement);
which could enable the functionality.  Default placement would stay the
same. With 0 for default, 1 for two direction placement.


--
Hannes



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[E-devel] e_menu patch for smarter placement

2006-08-13 Thread Hannes Janetzek
Hello,

I made a patch for e_menu that minimizes the need for vertical
scrolling. 

The submenu starts either above or below the actual
Item, not only below. It works as follows: if the menu is larger than
the screen then place the menu so that more is shown. e.g. if its start
in the lower half of the screen more is shown when the menu is above.
If the menu is smaller than the screen but it goes offscreen then it is
also tested if the menu should go above.

The submenu starts of  course direct next to the actual item. The terms
above and below could be misleading.

If this should be made an option I can change the patch, though i could
hardly understand why someone would like it less comfortable :) 


Hannes


 Index: e_menu.c
===
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_menu.c,v
retrieving revision 1.58
diff -u -r1.58 e_menu.c
--- e_menu.c	9 Aug 2006 15:24:34 -	1.58
+++ e_menu.c	13 Aug 2006 21:14:34 -
@@ -1823,7 +1823,29 @@

if (!m->parent_item) return;
m->cur.x = m->parent_item->menu->cur.x + m->parent_item->menu->cur.w;
-   m->cur.y = m->parent_item->menu->cur.y + m->parent_item->y - m->container_y;
+
+   int parent_item_bottom = m->parent_item->menu->cur.y + m->parent_item->y;
+   if(m->cur.h > m->zone->h)
+ {
+   /* menu is larger than screen */
+   if(parent_item_bottom > (m->zone->h / 2))
+ /* more is shown if menu goes up */
+ m->cur.y = (parent_item_bottom - (m->container_h + 1)); 
+   else
+ /* more is shown if menu goes down */
+ m->cur.y = parent_item_bottom - m->container_y;
+ }
+   else
+ {  
+   /* menu is smaller than screen */
+   if(((parent_item_bottom + m->cur.h - m->container_y) > m->zone->h) && 
+   (parent_item_bottom > (m->zone->h / 2)))
+ /* menu is partially out of screen and more is shown if menu goes up */
+ m->cur.y = (parent_item_bottom - (m->container_h + 1)); 
+   else
+ m->cur.y = parent_item_bottom - m->container_y;
+ }
+   
/* FIXME: this will suck for big menus */
for (l = _e_active_menus; l; l = l->next)
  {
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel