[elm_navigationbar_ex]: Application can show/hide title object with
authorShilpa Singh <shilpa.singh@samsung.com>
Wed, 17 Aug 2011 03:47:58 +0000 (12:47 +0900)
committerShilpa Singh <shilpa.singh@samsung.com>
Wed, 17 Aug 2011 03:52:57 +0000 (12:52 +0900)
out animation by emitting the signal.

Change-Id: Ic8ea742eec7ce8bc85c93541acdfe0a8273ddcc7

src/lib/Elementary.h.in
src/lib/elc_navigationbar_ex.c

index 8513883..8bb0f2f 100644 (file)
@@ -7963,7 +7963,10 @@ extern "C" {
    EAPI void         elm_navigationbar_title_icon_set(Evas_Object *obj, Evas_Object *content, Evas_Object *icon);
    EAPI Evas_Object *elm_navigationbar_title_icon_get(Evas_Object *obj, Evas_Object *content);
 
-     /* NavigationBar */
+   /* NavigationBar */
+   #define NAVIBAR_EX_TITLEOBJ_INSTANT_HIDE "elm,state,hide,noanimate,title", "elm"
+   #define NAVIBAR_EX_TITLEOBJ_INSTANT_SHOW "elm,state,show,noanimate,title", "elm"
+
    typedef enum
      {
         ELM_NAVIGATIONBAR_EX_BACK_BUTTON,
index 10b7376..710ac0a 100644 (file)
@@ -437,6 +437,35 @@ _switch_titleobj_visibility(void *data, Evas_Object *obj __UNUSED__, const char
      }\r
 }\r
 \r
+static void\r
+_emit_hook(Evas_Object *obj, const char *emission, const char *source)\r
+{\r
+   ELM_CHECK_WIDTYPE(obj, widtype);\r
+\r
+   Widget_Data *wd;\r
+   Eina_List *last;\r
+   Elm_Navigationbar_ex_Item *it;\r
+\r
+   wd = elm_widget_data_get(obj);\r
+   if (!wd) return;\r
+\r
+   last = eina_list_last(wd->stack);\r
+   if (!last) return;\r
+\r
+   it = eina_list_data_get(last);\r
+   if ((!it) || (!it->title_obj)) return;\r
+\r
+   if (!strcmp(source, "elm"))\r
+     {\r
+        if (!strcmp(emission, "elm,state,hide,noanimate,title"))\r
+          it->titleobj_visible = EINA_FALSE;\r
+        else if (!strcmp(emission, "elm,state,show,noanimate,title"))\r
+          it->titleobj_visible = EINA_TRUE;\r
+     }\r
+   /*sending signal to top most item of the stack*/\r
+   edje_object_signal_emit(it->base, emission, source);\r
+}\r
+\r
 /**\r
  * Add a new navigationbar_ex to the parent\r
  *\r
@@ -464,6 +493,7 @@ elm_navigationbar_ex_add(Evas_Object *parent)
    elm_widget_del_hook_set(obj, _del_hook);\r
    elm_widget_theme_hook_set(obj, _theme_hook);\r
    elm_widget_can_focus_set(obj, EINA_FALSE);\r
+   elm_widget_signal_emit_hook_set(obj, _emit_hook);\r
    wd->clip = evas_object_rectangle_add(e);\r
    elm_widget_resize_object_set(obj, wd->clip);\r
    elm_widget_sub_object_add(obj, wd->clip);\r