summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-03-24 02:10:59 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-03-24 02:10:59 +0900
commitf918fe7f317b80a2d67fcecfb1c64f06aa08df15 (patch)
tree8b5f9793f3f663ad663968b8fb215dbac1dc7cb1
parente97b9a790f21b0618c3696cfbe880b29c8edf7b8 (diff)
gengrid: Check disabled status of an item in nearest visible item.
-rw-r--r--src/lib/elm_gengrid.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index deffc7351..a362aa968 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -2123,22 +2123,30 @@ _elm_gengrid_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *it)
2123 Eina_List *item_list = NULL, *l = NULL; 2123 Eina_List *item_list = NULL, *l = NULL;
2124 Elm_Object_Item *item = NULL; 2124 Elm_Object_Item *item = NULL;
2125 ELM_GENGRID_DATA_GET(obj, sd); 2125 ELM_GENGRID_DATA_GET(obj, sd);
2126 Eina_Bool search_next = EINA_FALSE;
2126 2127
2127 if (!it) return NULL; 2128 if (!it) return NULL;
2128 2129
2129 evas_object_geometry_get(sd->pan_obj, &vx, &vy, &vw, &vh); 2130 evas_object_geometry_get(sd->pan_obj, &vx, &vy, &vw, &vh);
2130 evas_object_geometry_get(VIEW(it), &ix, &iy, &iw, &ih); // FIXME: check if the item is realized or not 2131 evas_object_geometry_get(VIEW(it), &ix, &iy, &iw, &ih); // FIXME: check if the item is realized or not
2131 2132
2133 item_list = elm_gengrid_realized_items_get(obj);
2134
2132 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, ix, iy, iw, ih)) 2135 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, ix, iy, iw, ih))
2133 return it; 2136 {
2137 if (!elm_object_item_disabled_get(it))
2138 return it;
2139 else
2140 search_next = EINA_TRUE;
2141 }
2134 2142
2135 item_list = elm_gengrid_realized_items_get(obj); 2143 if ((iy < vy) || search_next)
2136 if (iy < vy)
2137 { 2144 {
2138 EINA_LIST_FOREACH(item_list, l, item) 2145 EINA_LIST_FOREACH(item_list, l, item)
2139 { 2146 {
2140 evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch); 2147 evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch);
2141 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch)) 2148 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) &&
2149 !elm_object_item_disabled_get(item))
2142 return item; 2150 return item;
2143 } 2151 }
2144 } 2152 }
@@ -2147,7 +2155,8 @@ _elm_gengrid_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *it)
2147 EINA_LIST_REVERSE_FOREACH(item_list, l, item) 2155 EINA_LIST_REVERSE_FOREACH(item_list, l, item)
2148 { 2156 {
2149 evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch); 2157 evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch);
2150 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch)) 2158 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) &&
2159 !elm_object_item_disabled_get(item))
2151 return item; 2160 return item;
2152 } 2161 }
2153 } 2162 }