summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2013-10-14 13:53:27 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2013-10-14 13:56:27 +0900
commitb41cf11a151107b2b9e3162b7cc5c9c874f6fed5 (patch)
treeff787628b8512e3934a94723981a0b22793a00ff
parentd5ab0ccd4c6223e3dc73728ff09ed60784bc7dca (diff)
elc_hoversel: Support elm_object_item_signal_emit() in hoversel.
This works only when the item is actually created by clicking the hover button.
-rw-r--r--ChangeLog5
-rw-r--r--NEWS1
-rw-r--r--src/lib/elc_hoversel.c14
-rw-r--r--src/lib/elc_hoversel.h1
4 files changed, 19 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ec783e72c..68aba3ad0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1694,3 +1694,8 @@
1694 1694
1695 * popup : Change the behavior about adding or removing buttons to keep the 1695 * popup : Change the behavior about adding or removing buttons to keep the
1696 user defined position of button. 1696 user defined position of button.
1697
16982013-10-14 Daniel Juyung Seo (SeoZ)
1699
1700 * hoversel: Support elm_object_item_signal_emit in hoversel. This works
1701 only when the item is created.
diff --git a/NEWS b/NEWS
index 9af53550e..a3bea3f9a 100644
--- a/NEWS
+++ b/NEWS
@@ -96,6 +96,7 @@ Additions:
96 * Add elm_menu_item_subitems_clear(). 96 * Add elm_menu_item_subitems_clear().
97 * Add the configuration fileselector_double_tap_navigation_enable. 97 * Add the configuration fileselector_double_tap_navigation_enable.
98 * Add "activated" smart callback for fileselector. 98 * Add "activated" smart callback for fileselector.
99 * Add elm_object_item_signal_emit support in hoversel. This works only when the item is created.
99 100
100Improvements: 101Improvements:
101 102
diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c
index 9f47c6ede..b7ba0ee9f 100644
--- a/src/lib/elc_hoversel.c
+++ b/src/lib/elc_hoversel.c
@@ -97,7 +97,7 @@ _on_item_clicked(void *data,
97static void 97static void
98_activate(Evas_Object *obj) 98_activate(Evas_Object *obj)
99{ 99{
100 const Elm_Hoversel_Item *item; 100 Elm_Hoversel_Item *item;
101 Evas_Object *bt, *bx, *ic; 101 Evas_Object *bt, *bx, *ic;
102 const Eina_List *l; 102 const Eina_List *l;
103 char buf[4096]; 103 char buf[4096];
@@ -145,7 +145,7 @@ _activate(Evas_Object *obj)
145 145
146 EINA_LIST_FOREACH(sd->items, l, item) 146 EINA_LIST_FOREACH(sd->items, l, item)
147 { 147 {
148 bt = elm_button_add(bx); 148 VIEW(item) = bt = elm_button_add(bx);
149 elm_widget_mirrored_automatic_set(bt, EINA_FALSE); 149 elm_widget_mirrored_automatic_set(bt, EINA_FALSE);
150 elm_widget_mirrored_set(bt, elm_widget_mirrored_get(obj)); 150 elm_widget_mirrored_set(bt, elm_widget_mirrored_get(obj));
151 elm_object_style_set(bt, buf); 151 elm_object_style_set(bt, buf);
@@ -204,6 +204,15 @@ _item_text_get_hook(const Elm_Object_Item *it,
204 return ((Elm_Hoversel_Item *)it)->label; 204 return ((Elm_Hoversel_Item *)it)->label;
205} 205}
206 206
207static void
208_item_signal_emit_hook(Elm_Object_Item *it,
209 const char *emission,
210 const char *source)
211{
212 if (VIEW(it))
213 elm_object_signal_emit(VIEW(it), emission, source);
214}
215
207static Eina_Bool 216static Eina_Bool
208_item_del_pre_hook(Elm_Object_Item *it) 217_item_del_pre_hook(Elm_Object_Item *it)
209{ 218{
@@ -508,6 +517,7 @@ _item_add(Eo *obj, void *_pd, va_list *list)
508 517
509 elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook); 518 elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook);
510 elm_widget_item_text_get_hook_set(item, _item_text_get_hook); 519 elm_widget_item_text_get_hook_set(item, _item_text_get_hook);
520 elm_widget_item_signal_emit_hook_set(item, _item_signal_emit_hook);
511 521
512 item->label = eina_stringshare_add(label); 522 item->label = eina_stringshare_add(label);
513 item->icon_file = eina_stringshare_add(icon_file); 523 item->icon_file = eina_stringshare_add(icon_file);
diff --git a/src/lib/elc_hoversel.h b/src/lib/elc_hoversel.h
index d085491ae..afc290457 100644
--- a/src/lib/elc_hoversel.h
+++ b/src/lib/elc_hoversel.h
@@ -43,6 +43,7 @@
43 * Supported elm_object_item common APIs. 43 * Supported elm_object_item common APIs.
44 * @li elm_object_item_del 44 * @li elm_object_item_del
45 * @li elm_object_item_part_text_get 45 * @li elm_object_item_part_text_get
46 * @li elm_object_item_signal_emit - this works only when the item is created.
46 * 47 *
47 * See @ref tutorial_hoversel for an example. 48 * See @ref tutorial_hoversel for an example.
48 * @{ 49 * @{