summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorabhi <a.aryadipta@samsung.com>2014-06-07 14:54:28 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-06-07 14:56:06 +0900
commit5cb9b232732c49865e0bbaa56962f69b36320fdc (patch)
tree3589974d4691393af65a771360c4e05e8b807809
parentb1dcc40d2ff7846932772542ede05c171f3b7a33 (diff)
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.c12
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,
1917 else 1917 else
1918 return EINA_TRUE; 1918 return EINA_TRUE;
1919 } 1919 }
1920 if (dir == ELM_FOCUS_UP)
1921 return EINA_TRUE;
1920 } 1922 }
1921 else if (((sd->horizontal) && (dir == ELM_FOCUS_DOWN)) || 1923 else if (((sd->horizontal) && (dir == ELM_FOCUS_DOWN)) ||
1922 ((!sd->horizontal) && (dir == ELM_FOCUS_RIGHT))) 1924 ((!sd->horizontal) && (dir == ELM_FOCUS_RIGHT)))
@@ -1936,6 +1938,8 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
1936 else 1938 else
1937 return EINA_TRUE; 1939 return EINA_TRUE;
1938 } 1940 }
1941 if (dir == ELM_FOCUS_DOWN)
1942 return EINA_TRUE;
1939 } 1943 }
1940 else if (((!sd->horizontal) && (dir == ELM_FOCUS_UP)) || 1944 else if (((!sd->horizontal) && (dir == ELM_FOCUS_UP)) ||
1941 ((sd->horizontal) && (dir == ELM_FOCUS_LEFT))) 1945 ((sd->horizontal) && (dir == ELM_FOCUS_LEFT)))
@@ -1954,7 +1958,7 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
1954 { 1958 {
1955 col = cvw / sd->item_width; 1959 col = cvw / sd->item_width;
1956 if (col <= 0) col = 1; 1960 if (col <= 0) col = 1;
1957 if (tmp->position < col) 1961 if (tmp->position <= col)
1958 return EINA_TRUE; 1962 return EINA_TRUE;
1959 } 1963 }
1960 } 1964 }
@@ -1974,7 +1978,7 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
1974 if (x == 0) 1978 if (x == 0)
1975 { 1979 {
1976 if ((tmp->position <= (row * col)) && 1980 if ((tmp->position <= (row * col)) &&
1977 (tmp->position > (row *(col - 1)))) 1981 (tmp->position > (row * (col - 1))))
1978 return EINA_TRUE; 1982 return EINA_TRUE;
1979 } 1983 }
1980 else 1984 else
@@ -1993,13 +1997,13 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
1993 if (x == 0) 1997 if (x == 0)
1994 { 1998 {
1995 if ((tmp->position <= (col * row)) && 1999 if ((tmp->position <= (col * row)) &&
1996 (tmp->position >= (col *(row - 1)))) 2000 (tmp->position > (col * (row - 1))))
1997 return EINA_TRUE; 2001 return EINA_TRUE;
1998 } 2002 }
1999 else 2003 else
2000 { 2004 {
2001 if ((tmp->position <= ((col * row) + x)) && 2005 if ((tmp->position <= ((col * row) + x)) &&
2002 (tmp->position >= (col * row))) 2006 (tmp->position > (((col * (row - 1)) + x))))
2003 return EINA_TRUE; 2007 return EINA_TRUE;
2004 } 2008 }
2005 } 2009 }