summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-02-25 15:31:00 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-02-25 15:31:00 +0900
commit03c53655ce48a4da71fbd8cf6013a279c786ebe7 (patch)
treeb0c0fed9cbef13938fae40cb27524af802818f81
parent89dbb9bd271f78122bffd2804004a1489b9877d8 (diff)
downloadenlightenment-03c53655ce48a4da71fbd8cf6013a279c786ebe7.tar.gz
e - menus - fix autoscroll on zones not at 0 y...
-rw-r--r--src/bin/e_menu.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/bin/e_menu.c b/src/bin/e_menu.c
index 846b951568..043935c3a5 100644
--- a/src/bin/e_menu.c
+++ b/src/bin/e_menu.c
@@ -2490,27 +2490,37 @@ _e_menu_mouse_autoscroll_check(void)
{
int autoscroll_x = 0;
int autoscroll_y = 0;
+ E_Menu *m = NULL;
+ int mx, my;
- if (_e_menu_x - e_config->menu_autoscroll_cursor_margin <= 0)
+ mx = _e_menu_x;
+ my = _e_menu_y;
+ if (_e_active_menus)
+ {
+ m = eina_list_data_get(_e_active_menus);
+ if (m)
+ {
+ mx -= m->zone->x;
+ my -= m->zone->y;
+ }
+ }
+ if (mx - e_config->menu_autoscroll_cursor_margin <= 0)
{
if (_e_menu_outside_bounds_get(-1, 0)) autoscroll_x = -1;
}
- if (_e_menu_y - e_config->menu_autoscroll_cursor_margin <= 0)
+ if (my - e_config->menu_autoscroll_cursor_margin <= 0)
{
if (_e_menu_outside_bounds_get(0, -1)) autoscroll_y = -1;
}
if ((!autoscroll_x) && (!autoscroll_y))
{
- if (_e_active_menus)
+ if (m)
{
- E_Menu *m;
-
- m = eina_list_data_get(_e_active_menus);
- if (_e_menu_x + e_config->menu_autoscroll_cursor_margin >= (m->zone->w - 1))
+ if (mx + e_config->menu_autoscroll_cursor_margin >= (m->zone->w - 1))
{
if (_e_menu_outside_bounds_get(1, 0)) autoscroll_x = 1;
}
- if (_e_menu_y + e_config->menu_autoscroll_cursor_margin >= (m->zone->h - 1))
+ if (my + e_config->menu_autoscroll_cursor_margin >= (m->zone->h - 1))
{
if (_e_menu_outside_bounds_get(0, 1)) autoscroll_y = 1;
}