elementary/naviframe - try to read the titles only when title is set and title_area...
authorChunEon Park <chuneon.park@samsung.com>
Sat, 8 Jun 2013 09:17:16 +0000 (18:17 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Wed, 12 Jun 2013 05:39:52 +0000 (14:39 +0900)
elementary/naviframe - return as soon as possible

commit 9f16e2ff16c024c5053d2b508a59fb0925bbb733
Author: ChunEon Park <hermet>@hermet.pe.kr>
Date: Sat Jun 8 18:10:17 2013 +0900

commit e4617409c9e8a09497afa0203495da609d3e3d6c
Author: ChunEon Park <hermet>@hermet.pe.kr>
Date: Sat Jun 8 18:11:09 2013 +0900

src/lib/elc_naviframe.c

index 0e18e0c..7d82983 100644 (file)
@@ -337,11 +337,16 @@ static char *
 _access_info_cb(void *data, Evas_Object *obj __UNUSED__)
 {
    Evas_Object *layout;
+   Elm_Naviframe_Item *nit;
    Eina_Strbuf *buf;
    const char *info;
    char *ret;
 
-   layout = (Evas_Object *)data;
+   nit = data;
+
+   if (!nit->title_visible) return NULL;
+
+   layout = VIEW(nit);
    info = elm_object_part_text_get(layout, TITLE_PART);
    if (!info) return NULL;
 
@@ -364,7 +369,7 @@ _access_obj_process(Elm_Naviframe_Item *it, Eina_Bool is_access)
 {
    Evas_Object *ao, *eo;
 
-   if (is_access)
+   if (is_access && (it->title_label || it->subtitle_label))
      {
         ao = ((Elm_Widget_Item *)it)->access_obj;
 
@@ -376,7 +381,7 @@ _access_obj_process(Elm_Naviframe_Item *it, Eina_Bool is_access)
              _elm_access_text_set(_elm_access_object_get(ao),
                                  ELM_ACCESS_TYPE, E_("title"));
              _elm_access_callback_set(_elm_access_object_get(ao),
-                                      ELM_ACCESS_INFO, _access_info_cb, VIEW(it));
+                                      ELM_ACCESS_INFO, _access_info_cb, it);
 
              /* to access title access object, any idea? */
              ((Elm_Widget_Item *)it)->access_obj = ao;
@@ -384,13 +389,13 @@ _access_obj_process(Elm_Naviframe_Item *it, Eina_Bool is_access)
      }
    else
      {
-        if (it->title_label)
-          _elm_access_edje_object_part_object_unregister
-                (VIEW(it), elm_layout_edje_get(VIEW(it)), TITLE_ACCESS_PART);
-
         /* to access title access object, any idea? */
         ao = ((Elm_Widget_Item *)it)->access_obj;
         if (!ao) return;
+
+        if (it->title_label || it->subtitle_label)
+          _elm_access_edje_object_part_object_unregister
+             (VIEW(it), elm_layout_edje_get(VIEW(it)), TITLE_ACCESS_PART);
         evas_object_del(ao);
      }
 }