gengrid: fixed _elm_gengrid_item_edge_check for ELM_FOCUS_DOWN and ELM_FOCUS_UP for normal and horizontal mode

Summary:
Added fixes for:
1.Normal mode: ELM_FOCUS_DOWN and ELM_FOCUS_UP
2.Horizontal mode: ELM_FOCUS_DOWN and ELM_FOCUS_UP

(i)

1|2|3
4|5|6
7|8|9

_elm_gengrid_item_edge_check for ELM_FOCUS_DOWN returns EINA_TRUE for item no.6.
It should not. Fixed this.

(ii)

1|2|3
4|5|6
7

_elm_gengrid_item_edge_check returns EINA_FALSE for ELM_FOCUS_DOWN
for item no. 5 and 6 but EINA_TRUE for item no. 7.
It should return EINA_TRUE for item no. 5 and 6 instead.
Fixed this.

(iii)

1|2|3
4|

_elm_gengrid_item_edge_check returned EINA_FALSE for ELM_FOCUS_UP
for item no. 3. Fixed this.

(iv)

1|4|7
2|5|
3|6|

Horizontal Mode: _elm_gengrid_item_edge_check returned EINA_FALSE
for ELM_FOCUS_DOWN for item no. 7. Fixed this.

(v)

1|4|7
2|5|
3|6|

Horizontal Mode: _elm_gengrid_item_edge_check returned EINA_FALSE
for ELM_FOCUS_UP for item no. 1. Fixed this.

Test Plan: elementary_test -to gengrid2

Reviewers: seoz, raster

CC: singh.amitesh, raster

Differential Revision: https://phab.enlightenment.org/D841

Conflicts:
	src/lib/elm_gengrid.c
This commit is contained in:
abhi 2014-06-07 14:54:28 +09:00 committed by Carsten Haitzler (Rasterman)
parent 19f48ea7df
commit e45774f6f2
1 changed files with 8 additions and 4 deletions

View File

@ -1917,6 +1917,8 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
else
return EINA_TRUE;
}
if (dir == ELM_FOCUS_UP)
return EINA_TRUE;
}
else if (((sd->horizontal) && (dir == ELM_FOCUS_DOWN)) ||
((!sd->horizontal) && (dir == ELM_FOCUS_RIGHT)))
@ -1936,6 +1938,8 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
else
return EINA_TRUE;
}
if (dir == ELM_FOCUS_DOWN)
return EINA_TRUE;
}
else if (((!sd->horizontal) && (dir == ELM_FOCUS_UP)) ||
((sd->horizontal) && (dir == ELM_FOCUS_LEFT)))
@ -1954,7 +1958,7 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
{
col = cvw / sd->item_width;
if (col <= 0) col = 1;
if (tmp->position < col)
if (tmp->position <= col)
return EINA_TRUE;
}
}
@ -1974,7 +1978,7 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
if (x == 0)
{
if ((tmp->position <= (row * col)) &&
(tmp->position > (row *(col - 1))))
(tmp->position > (row * (col - 1))))
return EINA_TRUE;
}
else
@ -1993,13 +1997,13 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
if (x == 0)
{
if ((tmp->position <= (col * row)) &&
(tmp->position >= (col *(row - 1))))
(tmp->position > (col * (row - 1))))
return EINA_TRUE;
}
else
{
if ((tmp->position <= ((col * row) + x)) &&
(tmp->position >= (col * row)))
(tmp->position > (((col * (row - 1)) + x))))
return EINA_TRUE;
}
}