summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2014-07-31 21:26:14 +0900
committerShinwoo Kim <kimcinoo.efl@gmail.com>2014-07-31 21:57:45 +0900
commitd5218350490f893e115f59d274570d11b4af6e4c (patch)
tree7f475cba72922cac86deec5a25ce95369b720008
parent1279a5c467961cf00db8abc018851a3aa4c67439 (diff)
elc_naviframe: Fix access info set for naviframe prev_btn and next_btn.
Summary: Do not set access info for naviframe prev_btn and next_btn when their access info are already set. Reviewers: Hermet, kimcinoo Reviewed By: kimcinoo Differential Revision: https://phab.enlightenment.org/D1255
-rw-r--r--src/lib/elc_naviframe.c43
1 files changed, 38 insertions, 5 deletions
diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c
index 2e58c44b9..1c6d7b832 100644
--- a/src/lib/elc_naviframe.c
+++ b/src/lib/elc_naviframe.c
@@ -280,6 +280,27 @@ _access_object_get(Elm_Naviframe_Item *it, const char* part)
280 return ao; 280 return ao;
281} 281}
282 282
283static Eina_Bool
284_access_info_has(Evas_Object *obj, int type)
285{
286 Elm_Access_Info *ac;
287 Elm_Access_Item *ai;
288 Eina_List *l;
289
290 ac = _elm_access_info_get(obj);
291 if (!ac) return EINA_FALSE;
292
293 EINA_LIST_FOREACH(ac->items, l, ai)
294 {
295 if (ai->type == type)
296 {
297 if (ai->func || ai->data) return EINA_TRUE;
298 }
299 }
300
301 return EINA_FALSE;
302}
303
283static void 304static void
284_item_signals_emit(Elm_Naviframe_Item *it) 305_item_signals_emit(Elm_Naviframe_Item *it)
285{ 306{
@@ -1203,9 +1224,15 @@ _item_new(Evas_Object *obj,
1203 _item_content_set_hook((Elm_Object_Item *)it, PREV_BTN_PART, prev_btn); 1224 _item_content_set_hook((Elm_Object_Item *)it, PREV_BTN_PART, prev_btn);
1204 1225
1205 if (!elm_layout_text_get(prev_btn, NULL)) 1226 if (!elm_layout_text_get(prev_btn, NULL))
1206 _elm_access_callback_set 1227 {
1207 (_elm_access_info_get(prev_btn), ELM_ACCESS_INFO, 1228 if (!_access_info_has(prev_btn, ELM_ACCESS_INFO))
1208 _access_prev_btn_info_cb, it); 1229 {
1230 /* set access info */
1231 _elm_access_callback_set
1232 (_elm_access_info_get(prev_btn), ELM_ACCESS_INFO,
1233 _access_prev_btn_info_cb, it);
1234 }
1235 }
1209 } 1236 }
1210 1237
1211 if (next_btn) 1238 if (next_btn)
@@ -1213,8 +1240,14 @@ _item_new(Evas_Object *obj,
1213 _item_content_set_hook((Elm_Object_Item *)it, NEXT_BTN_PART, next_btn); 1240 _item_content_set_hook((Elm_Object_Item *)it, NEXT_BTN_PART, next_btn);
1214 1241
1215 if (!elm_layout_text_get(next_btn, NULL)) 1242 if (!elm_layout_text_get(next_btn, NULL))
1216 _elm_access_text_set 1243 {
1217 (_elm_access_info_get(next_btn), ELM_ACCESS_INFO, E_("Next")); 1244 if (!_access_info_has(next_btn, ELM_ACCESS_INFO))
1245 {
1246 /* set access info */
1247 _elm_access_text_set
1248 (_elm_access_info_get(next_btn), ELM_ACCESS_INFO, E_("Next"));
1249 }
1250 }
1218 } 1251 }
1219 1252
1220 _item_content_set(it, content); 1253 _item_content_set(it, content);