[multibuttonentry] when mbe gets/loses focus, state/color of items is changed
authorBora Hwang <bora1.hwang@samsung.com>
Fri, 28 Jun 2013 08:00:05 +0000 (17:00 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Mon, 1 Jul 2013 07:53:20 +0000 (16:53 +0900)
Change-Id: If8371c4c0b70f331198fee17f5d59d39e09dc5fb

src/lib/elc_multibuttonentry.c

index dc6b59c..1b28736 100644 (file)
@@ -1995,6 +1995,9 @@ _elm_multibuttonentry_smart_on_focus(Evas_Object *obj)
    if (!ELM_WIDGET_CLASS(_elm_multibuttonentry_parent_sc)->on_focus(obj))
      return EINA_FALSE;
 
+   Eina_List *l;
+   Elm_Multibuttonentry_Item *it;
+
    if (elm_object_focus_get(obj))
      {
         // ACCESS
@@ -2021,6 +2024,12 @@ _elm_multibuttonentry_smart_on_focus(Evas_Object *obj)
              elm_object_focus_set(sd->entry, EINA_TRUE);
           }
 
+        EINA_LIST_FOREACH(sd->items, l, it)
+          {
+             elm_layout_signal_emit(VIEW(it), "default", "");
+             edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
+          }
+
         evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
      }
    else
@@ -2047,6 +2056,12 @@ _elm_multibuttonentry_smart_on_focus(Evas_Object *obj)
           evas_object_focus_set
              (elm_layout_edje_get(VIEW(sd->selected_item)), EINA_FALSE);
 
+        EINA_LIST_FOREACH(sd->items, l, it)
+          {
+             elm_layout_signal_emit(VIEW(it), "lose_focus", "");
+             edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
+          }
+
         evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
      }
 
@@ -2469,6 +2484,7 @@ elm_multibuttonentry_item_prepend(Evas_Object *obj,
                                   const void *data)
 {
    Elm_Multibuttonentry_Item *it;
+   Eina_List *l;
 
    ELM_MULTIBUTTONENTRY_CHECK(obj) NULL;
    ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
@@ -2522,6 +2538,15 @@ elm_multibuttonentry_item_prepend(Evas_Object *obj,
 #endif
      }
 
+   if (!elm_object_focus_get(obj))
+     {
+        EINA_LIST_FOREACH(sd->items, l, it)
+          {
+             elm_layout_signal_emit(VIEW(it), "lose_focus", "");
+             edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
+          }
+     }
+
 #ifdef _VI_EFFECT
    if (!sd->boxh || !sd->boxw)
      evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, it);
@@ -2539,6 +2564,7 @@ elm_multibuttonentry_item_append(Evas_Object *obj,
                                  const void *data)
 {
    Elm_Multibuttonentry_Item *it;
+   Eina_List *l;
 
    ELM_MULTIBUTTONENTRY_CHECK(obj) NULL;
    ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
@@ -2592,6 +2618,15 @@ elm_multibuttonentry_item_append(Evas_Object *obj,
 #endif
      }
 
+   if (!elm_object_focus_get(obj))
+     {
+        EINA_LIST_FOREACH(sd->items, l, it)
+          {
+             elm_layout_signal_emit(VIEW(it), "lose_focus", "");
+             edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
+          }
+     }
+
 #ifdef _VI_EFFECT
    if (!sd->boxh || !sd->boxw)
      evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, it);
@@ -2610,6 +2645,7 @@ elm_multibuttonentry_item_insert_before(Evas_Object *obj,
                                         const void *data)
 {
    Elm_Multibuttonentry_Item *it;
+   Eina_List *l;
 
    ELM_MULTIBUTTONENTRY_CHECK(obj) NULL;
    ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
@@ -2645,6 +2681,15 @@ elm_multibuttonentry_item_insert_before(Evas_Object *obj,
 #endif
      }
 
+   if (!elm_object_focus_get(obj))
+     {
+        EINA_LIST_FOREACH(sd->items, l, it)
+          {
+             elm_layout_signal_emit(VIEW(it), "lose_focus", "");
+             edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
+          }
+     }
+
 #ifdef _VI_EFFECT
    if (!sd->boxh || !sd->boxw)
      evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, it);
@@ -2663,6 +2708,7 @@ elm_multibuttonentry_item_insert_after(Evas_Object *obj,
                                        const void *data)
 {
    Elm_Multibuttonentry_Item *it;
+   Eina_List *l;
 
    ELM_MULTIBUTTONENTRY_CHECK(obj) NULL;
    ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
@@ -2698,6 +2744,15 @@ elm_multibuttonentry_item_insert_after(Evas_Object *obj,
 #endif
      }
 
+   if (!elm_object_focus_get(obj))
+     {
+        EINA_LIST_FOREACH(sd->items, l, it)
+          {
+             elm_layout_signal_emit(VIEW(it), "lose_focus", "");
+             edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
+          }
+     }
+
 #ifdef _VI_EFFECT
    if (!sd->boxh || !sd->boxw)
      evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, it);