elementary/naviframe - fix the naviframe to send the signals one time for content...
authorChunEon Park <hermet@hermet.pe.kr>
Fri, 30 Nov 2012 13:16:11 +0000 (13:16 +0000)
committerChunEon Park <hermet@hermet.pe.kr>
Fri, 30 Nov 2012 13:16:11 +0000 (13:16 +0000)
SVN revision: 79890

ChangeLog
NEWS
src/lib/elc_naviframe.c

index 8df7726..3374030 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 2012-11-30  ChunEon Park (Hermet)
 
         * Fix the naviframe to resize it's items which are inserted.
+
+2012-11-30  ChunEon Park (Hermet)
+
+        * emit the signals for content_set/unset text_set/unset one time!
diff --git a/NEWS b/NEWS
index 1ba745a..61a6f07 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -67,7 +67,8 @@ Fixes:
    * Fix entry to enable have_selection only when a text is actually selected.
    * Fix the naviframe to clear the text parts when it's item is deleted.
    * Fix the mapbuf to update it's content correcltly evenif they go outside of the buffer.
-   * Fix the naviframe to resize it's items which are inserted.        
+   * Fix the naviframe to resize it's items which are inserted.
+   * Fix the naviframe to send signal emits one time for content show/hide, text show/hide.
 
 Removals:
 
index 696110e..c9fead1 100644 (file)
@@ -191,9 +191,9 @@ _item_text_signals_emit(Elm_Naviframe_Item *it)
    char buf[1024];
 
    if ((it->title_label) && (it->title_label[0]))
-     edje_object_signal_emit(VIEW(it), "elm,state,title_label,show", "elm");
+     edje_object_signal_emit(VIEW(it), "elm,state,title,show", "elm");
    else
-     edje_object_signal_emit(VIEW(it), "elm,state,title_label,hide", "elm");
+     edje_object_signal_emit(VIEW(it), "elm,state,title,hide", "elm");
 
    if ((it->subtitle_label) && (it->subtitle_label[0]))
      edje_object_signal_emit(VIEW(it), "elm,state,subtitle,show", "elm");
@@ -379,11 +379,19 @@ _item_text_set_hook(Elm_Object_Item *it,
      {
         eina_stringshare_replace(&nit->title_label, label);
         snprintf(buf, sizeof(buf), "elm.text.title");
+        if (label)
+          edje_object_signal_emit(VIEW(it), "elm,state,title,show", "elm");
+        else
+          edje_object_signal_emit(VIEW(it), "elm,state,title,hide", "elm");
      }
    else if (!strcmp("subtitle", part))
      {
         eina_stringshare_replace(&nit->subtitle_label, label);
         snprintf(buf, sizeof(buf), "elm.text.subtitle");
+        if (label)
+          edje_object_signal_emit(VIEW(it), "elm,state,subtitle,show", "elm");
+        else
+          edje_object_signal_emit(VIEW(it), "elm,state,subtitle,hide", "elm");
      }
    else
      {
@@ -403,12 +411,14 @@ _item_text_set_hook(Elm_Object_Item *it,
              eina_stringshare_replace(&pair->part, buf);
              nit->text_list = eina_inlist_append(nit->text_list,
                                                  EINA_INLIST_GET(pair));
+             if (label)
+               snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
+             else
+               snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
+             edje_object_signal_emit(VIEW(it), buf, "elm");
           }
      }
 
-   edje_object_part_text_set(VIEW(nit), buf, label);
-   _item_text_signals_emit(nit);
-
    /* access */
    if (_elm_config->access_mode)
      _access_obj_process(nit, EINA_TRUE);
@@ -499,6 +509,7 @@ _item_content_set(Elm_Naviframe_Item *it,
    if (!content) return;
 
    edje_object_part_swallow(VIEW(it), CONTENT_PART, content);
+   edje_object_signal_emit(VIEW(it), "elm,state,content,show", "elm");
 
    evas_object_event_callback_add
      (content, EVAS_CALLBACK_DEL, _item_content_del_cb, it);
@@ -514,6 +525,7 @@ _item_title_prev_btn_set(Elm_Naviframe_Item *it,
    if (!btn) return;
 
    edje_object_part_swallow(VIEW(it), PREV_BTN_PART, btn);
+   edje_object_signal_emit(VIEW(it), "elm,state,prev_btn,show", "elm");
 
    evas_object_event_callback_add
      (btn, EVAS_CALLBACK_DEL, _item_title_prev_btn_del_cb, it);
@@ -529,6 +541,7 @@ _item_title_next_btn_set(Elm_Naviframe_Item *it,
    if (!btn) return;
 
    edje_object_part_swallow(VIEW(it), NEXT_BTN_PART, btn);
+   edje_object_signal_emit(VIEW(it), "elm,state,next_btn,show", "elm");
 
    evas_object_event_callback_add
      (btn, EVAS_CALLBACK_DEL, _item_title_next_btn_del_cb, it);
@@ -544,6 +557,7 @@ _item_title_icon_set(Elm_Naviframe_Item *it,
    if (!icon) return;
 
    edje_object_part_swallow(VIEW(it), ICON_PART, icon);
+   edje_object_signal_emit(VIEW(it), "elm,state,icon,show", "elm");
 
    evas_object_event_callback_add
      (icon, EVAS_CALLBACK_DEL, _item_title_icon_del_cb, it);
@@ -557,6 +571,7 @@ _item_content_unset(Elm_Naviframe_Item *it)
    if (!content) return NULL;
 
    edje_object_part_unswallow(VIEW(it), it->content);
+   edje_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
 
    evas_object_event_callback_del
      (content, EVAS_CALLBACK_DEL, _item_content_del_cb);
@@ -573,6 +588,7 @@ _item_title_prev_btn_unset(Elm_Naviframe_Item *it)
    if (!content) return NULL;
 
    edje_object_part_unswallow(VIEW(it), it->title_prev_btn);
+   edje_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
 
    evas_object_event_callback_del
      (content, EVAS_CALLBACK_DEL, _item_title_prev_btn_del_cb);
@@ -589,6 +605,7 @@ _item_title_next_btn_unset(Elm_Naviframe_Item *it)
    if (!content) return NULL;
 
    edje_object_part_unswallow(VIEW(it), it->title_next_btn);
+   edje_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
 
    evas_object_event_callback_del
      (content, EVAS_CALLBACK_DEL, _item_title_next_btn_del_cb);
@@ -605,6 +622,7 @@ _item_title_icon_unset(Elm_Naviframe_Item *it)
    if (!content) return NULL;
 
    edje_object_part_unswallow(VIEW(it), it->title_icon);
+   edje_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
 
    evas_object_event_callback_del
      (content, EVAS_CALLBACK_DEL, _item_title_icon_del_cb);
@@ -642,18 +660,15 @@ _title_content_set(Elm_Naviframe_Item *it,
    if (pair)
      {
         prev_content = edje_object_part_swallow_get(VIEW(it), part);
-        if (prev_content != content)
+        if (prev_content == content) return;
+        if (content)
+          edje_object_part_swallow(VIEW(it), part, content);
+        if (prev_content)
           {
-             if (content)
-               {
-                  evas_object_event_callback_del(prev_content,
-                                                 EVAS_CALLBACK_DEL,
-                                                 _title_content_del);
-                  snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
-                  elm_object_signal_emit(VIEW(it), buf, "elm");
-               }
+             evas_object_event_callback_del(prev_content,
+                                            EVAS_CALLBACK_DEL,
+                                            _title_content_del);
              evas_object_del(prev_content);
-             if (!content) return;
           }
      }
    else
@@ -670,15 +685,14 @@ _title_content_set(Elm_Naviframe_Item *it,
         eina_stringshare_replace(&pair->part, part);
         it->content_list = eina_inlist_append(it->content_list,
                                               EINA_INLIST_GET(pair));
-      }
-    if (prev_content != content)
-      {
-         evas_object_event_callback_add(content,
-                                        EVAS_CALLBACK_DEL,
-                                        _title_content_del,
-                                        pair);
-      }
-    edje_object_part_swallow(VIEW(it), part, content);
+        evas_object_event_callback_add(content,
+                                       EVAS_CALLBACK_DEL,
+                                       _title_content_del,
+                                       pair);
+        edje_object_part_swallow(VIEW(it), part, content);
+        snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
+        edje_object_signal_emit(VIEW(it), buf, "elm");
+     }
 }
 
 static void
@@ -702,8 +716,6 @@ _item_content_set_hook(Elm_Object_Item *it,
    else
      _title_content_set(nit, part, content);
 
-   _item_content_signals_emit(nit);
-
    elm_layout_sizing_eval(WIDGET(it));
 }
 
@@ -781,8 +793,6 @@ _item_content_unset_hook(Elm_Object_Item *it,
    else
      o = _title_content_unset(nit, part);
 
-   _item_content_signals_emit(nit);
-
    elm_layout_sizing_eval(WIDGET(it));
 
    return o;