Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h menus.c settings.c
Log Message:
Fix various menu animation/sliding bugs.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.398
retrieving revision 1.399
diff -u -3 -r1.398 -r1.399
--- E.h 28 Mar 2005 13:39:22 -0000 1.398
+++ E.h 28 Mar 2005 18:20:27 -0000 1.399
@@ -845,7 +845,7 @@
} hints;
struct
{
- char slide;
+ char animate;
char onscreen;
char warp;
int opacity;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/menus.c,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -3 -r1.177 -r1.178
--- menus.c 20 Mar 2005 17:31:13 -0000 1.177
+++ menus.c 28 Mar 2005 18:20:47 -0000 1.178
@@ -357,7 +357,7 @@
ESelectInput(m->win, ewin->client.event_mask);
ewin->head = head_num;
- if (Conf.menus.slide)
+ if (Conf.menus.animate)
EwinInstantShade(ewin, 0);
ICCCM_Cmap(NULL);
MoveEwin(ewin, EoGetX(ewin), EoGetY(ewin));
@@ -365,7 +365,7 @@
if (!noshow)
{
ShowEwin(ewin);
- if (Conf.menus.slide)
+ if (Conf.menus.animate)
EwinUnShade(ewin);
}
}
@@ -1353,7 +1353,7 @@
ewin2->border->border.top);
RaiseEwin(ewin2);
ShowEwin(ewin2);
- if (Conf.menus.slide)
+ if (Conf.menus.animate)
EwinUnShade(ewin2);
Mode_menus.list[Mode_menus.current_depth++] = mi->child;
}
@@ -1590,7 +1590,7 @@
static void
SubmenuShowTimeout(int val __UNUSED__, void *dat)
{
- int mx, my;
+ int mx, my, xo, yo;
unsigned int mw, mh;
Menu *m;
MenuItem *mi;
@@ -1617,18 +1617,10 @@
return;
EGetGeometry(mi->win, NULL, &mx, &my, &mw, &mh, NULL, NULL);
- MoveEwin(ewin2,
- EoGetX(ewin) + ewin->border->border.left + mx + mw,
- EoGetY(ewin) + ewin->border->border.top + my -
- ewin2->border->border.top);
- RaiseEwin(ewin2);
- ShowEwin(ewin2);
-
- if (Conf.menus.slide)
- EwinUnShade(ewin2);
- if (Mode_menus.list[Mode_menus.current_depth - 1] != mi->child)
- Mode_menus.list[Mode_menus.current_depth++] = mi->child;
+ /* Sub-menu offsets relative to parent menu origin */
+ xo = ewin->border->border.left + mx + mw;
+ yo = ewin->border->border.top + my - ewin2->border->border.top;
if (Conf.menus.onscreen)
{
@@ -1637,13 +1629,20 @@
int fy[256];
int tx[256];
int ty[256];
- int i;
+ int i, ww, hh;
int xdist = 0, ydist = 0;
- if (EoGetX(ewin2) + EoGetW(ewin2) > VRoot.w)
- xdist = VRoot.w - (EoGetX(ewin2) + EoGetW(ewin2));
- if (EoGetY(ewin2) + EoGetH(ewin2) > VRoot.h)
- ydist = VRoot.h - (EoGetY(ewin2) + EoGetH(ewin2));
+ /* Size of new submenu (may be shaded atm.) */
+ ww = mi->child->w + ewin2->border->border.left +
+ ewin2->border->border.right;
+ hh = mi->child->h + ewin2->border->border.top +
+ ewin2->border->border.bottom;
+
+ if (EoGetX(ewin) + xo + ww > VRoot.w)
+ xdist = VRoot.w - (EoGetX(ewin) + xo + ww);
+ if (EoGetY(ewin) + yo + hh > VRoot.h)
+ ydist = VRoot.h - (EoGetY(ewin) + yo + hh);
+
if ((xdist != 0) || (ydist != 0))
{
for (i = 0; i < Mode_menus.current_depth; i++)
@@ -1674,6 +1673,18 @@
mi->text_w / 2, mi->text_h / 2);
}
}
+
+ Mode.move.check = 0; /* Bypass on-screen checks */
+ MoveEwin(ewin2, EoGetX(ewin) + xo, EoGetY(ewin) + yo);
+ Mode.move.check = 1;
+ RaiseEwin(ewin2);
+ ShowEwin(ewin2);
+
+ if (Conf.menus.animate)
+ EwinUnShade(ewin2);
+
+ if (Mode_menus.list[Mode_menus.current_depth - 1] != mi->child)
+ Mode_menus.list[Mode_menus.current_depth++] = mi->child;
}
static void
@@ -2254,7 +2265,7 @@
#define N_IPC_FUNCS (sizeof(MenusIpcArray)/sizeof(IpcItem))
static const CfgItem MenusCfgItems[] = {
- CFG_ITEM_BOOL(Conf.menus, slide, 0),
+ CFG_ITEM_BOOL(Conf.menus, animate, 0),
CFG_ITEM_BOOL(Conf.menus, onscreen, 1),
CFG_ITEM_BOOL(Conf.menus, warp, 1),
CFG_ITEM_INT(Conf.menus, opacity, 220),
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/settings.c,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -3 -r1.134 -r1.135
--- settings.c 28 Mar 2005 13:39:32 -0000 1.134
+++ settings.c 28 Mar 2005 18:20:51 -0000 1.135
@@ -1147,7 +1147,7 @@
{
Conf.save_under = tmp_saveunders;
Conf.menus.warp = tmp_warpmenus;
- Conf.menus.slide = tmp_animated_menus;
+ Conf.menus.animate = tmp_animated_menus;
Conf.menus.onscreen = tmp_menusonscreen;
Conf.mapslide = tmp_map_slide;
Conf.cleanupslide = tmp_cleanup_slide;
@@ -1178,7 +1178,7 @@
tmp_saveunders = Conf.save_under;
tmp_warpmenus = Conf.menus.warp;
- tmp_animated_menus = Conf.menus.slide;
+ tmp_animated_menus = Conf.menus.animate;
tmp_menusonscreen = Conf.menus.onscreen;
tmp_map_slide = Conf.mapslide;
tmp_cleanup_slide = Conf.cleanupslide;
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs