diff options
author | abhi <a.aryadipta@samsung.com> | 2014-06-07 14:54:28 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2014-06-07 14:56:06 +0900 |
commit | 5cb9b232732c49865e0bbaa56962f69b36320fdc (patch) | |
tree | 3589974d4691393af65a771360c4e05e8b807809 | |
parent | b1dcc40d2ff7846932772542ede05c171f3b7a33 (diff) | |
download | elementary-5cb9b232732c49865e0bbaa56962f69b36320fdc.tar.gz |
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
-rw-r--r-- | src/lib/elm_gengrid.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c index 73406ef34..286889637 100644 --- a/src/lib/elm_gengrid.c +++ b/src/lib/elm_gengrid.c @@ -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; } } |