Colorselector: Item_signal_emit_hook added.
authorDaniel Juyung Seo <seojuyung2@gmail.com>
Mon, 3 Feb 2014 15:30:37 +0000 (00:30 +0900)
committerDaniel Juyung Seo <seojuyung2@gmail.com>
Mon, 3 Feb 2014 15:32:05 +0000 (00:32 +0900)
Summary:
Issue: If application has to preselect an item, or change item properties by customizing theme
there is no option provided for the same.
Solution: Add item_signal_emit_hook.
Signed-off by: Shilpa Singh <shilpa.singh@samsung.com>

Test Plan:
Send a signal to item and verify UI
Elm_Object_Item *item = elm_colorselector_palette_color_add(cs, 133, 100, 255, 255);
elm_object_item_signal_emit(item, "elm,state,selected", "elm");

Reviewers: seoz, Hermet

Reviewed By: seoz

CC: govi
Differential Revision: https://phab.enlightenment.org/D504

src/lib/elm_colorselector.c

index 3aa84d1..fddd110 100644 (file)
@@ -1372,6 +1372,14 @@ _item_resize(void *data EINA_UNUSED,
    elm_layout_sizing_eval(obj);
 }
 
+static void
+_item_signal_emit_hook(Elm_Object_Item *it,
+                       const char *emission,
+                       const char *source)
+{
+   elm_object_signal_emit(VIEW(it), emission, source);
+}
+
 static Elm_Color_Item *
 _item_new(Evas_Object *obj)
 {
@@ -1404,6 +1412,8 @@ _item_new(Evas_Object *obj)
      (item->color_obj, EVAS_CALLBACK_MOUSE_UP, _on_color_released, item);
    elm_object_part_content_set(VIEW(item), "color_obj", item->color_obj);
 
+   elm_widget_item_signal_emit_hook_set(item, _item_signal_emit_hook);
+
    _item_sizing_eval(item);
    evas_object_show(VIEW(item));