seoz pushed a commit to branch master. http://git.enlightenment.org/tools/elm-theme-viewer.git/commit/?id=40f913bcfbc43774be34813a34030aae6985b72a
commit 40f913bcfbc43774be34813a34030aae6985b72a Author: Daniel Juyung Seo <[email protected]> Date: Sun Aug 17 01:26:39 2014 +0900 widget: added notify widget support. --- src/bin/widget.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/src/bin/widget.c b/src/bin/widget.c index 47a7d17..1a94d77 100644 --- a/src/bin/widget.c +++ b/src/bin/widget.c @@ -1405,6 +1405,68 @@ _widget_naviframe_create(Evas_Object *parent, const char *style) return o; } +static void +_widget_notify_response_cb(void *data EINA_UNUSED, Evas_Object *obj, + void *event_info EINA_UNUSED) +{ + evas_object_del(obj); +} + +static void +_widget_notify_close_cb(void *data, Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + evas_object_del(data); +} + +static void +_widget_notify_launch(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Evas_Object *o = NULL, *box = NULL, *lbl = NULL, *btn = NULL; + + o = elm_notify_add(gd->win); + evas_object_smart_callback_add(o, "block,clicked", + _widget_notify_response_cb, NULL); + + elm_notify_allow_events_set(o, EINA_FALSE); + evas_object_show(o); + + //elm_notify_align_set + //elm_notify_timeout_set + //elm_notify_allow_events_set + + box = elm_box_add(o); + elm_object_content_set(o, box); + evas_object_show(box); + + lbl = elm_label_add(box); + elm_object_text_set(lbl, "This is a notify widget."); + elm_box_pack_end(box, lbl); + evas_object_show(lbl); + + btn = elm_button_add(box); + elm_object_text_set(btn, "Close"); + evas_object_smart_callback_add(btn, "clicked", _widget_notify_close_cb, o); + elm_box_pack_end(box, btn); + evas_object_show(btn); +} + +// notify +static Evas_Object * +_widget_notify_create(Evas_Object *parent, const char *style) +{ + Evas_Object *o = NULL; + + o = elm_button_add(parent); + WEIGHT(o, EVAS_HINT_EXPAND, 0.0); FILL(o); + elm_object_text_set(o, "Press to launch a notify"); + evas_object_smart_callback_add(o, "clicked", _widget_notify_launch, style); + evas_object_show(o); + + return o; +} + // panel static Evas_Object * _widget_panel_create(Evas_Object *parent, const char *orig_style) @@ -2093,6 +2155,7 @@ widget_create(Evas_Object *parent, Widget_Type widget, const char *orig_style) ADD_WIDGET(menu, ETV_ID_MENU, orig_style); ADD_WIDGET(multibuttonentry, ETV_ID_MULTIBUTTONENTRY, style); ADD_WIDGET(naviframe, ETV_ID_NAVIFRAME, style); + ADD_WIDGET(notify, ETV_ID_NOTIFY, style); ADD_WIDGET(panel, ETV_ID_PANEL, orig_style); ADD_WIDGET(photo, ETV_ID_PHOTO, style); ADD_WIDGET(player, ETV_ID_PLAYER, style); --
