summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/define.h1
-rw-r--r--src/util.c10
2 files changed, 11 insertions, 0 deletions
diff --git a/include/define.h b/include/define.h
index 2229a34..6e6279a 100644
--- a/include/define.h
+++ b/include/define.h
@@ -46,6 +46,7 @@
#define SIGNAL_NO_FAVORITE "elm,state,no_favorite"
#define SIGNAL_TOGGLE "elm,state,toggle"
#define SIGNAL_UNTOGGLE "elm,state,untoggle"
+#define SIGNAL_TIMEOUT "timeout"
#define FONT_REGULAR "TizenSans"
#define FONT_LIGHT "TizenSans:style=Light"
diff --git a/src/util.c b/src/util.c
index 518fad5..041d77b 100644
--- a/src/util.c
+++ b/src/util.c
@@ -159,6 +159,14 @@ Evas_Object *util_add_button(Evas_Object *parent, const char *part,
return btn;
}
+static void _notify_timeout_cb(void *data, Evas_Object *obj, void *ei)
+{
+ if (!obj)
+ return;
+
+ evas_object_del(obj);
+}
+
Evas_Object *util_add_toast(Evas_Object *parent, char *text)
{
Evas_Object *toast, *content;
@@ -177,6 +185,8 @@ Evas_Object *util_add_toast(Evas_Object *parent, char *text)
elm_object_style_set(toast, STYLE_TOAST);
elm_notify_align_set(toast, 0.0, 1.0);
elm_notify_timeout_set(toast, TOAST_TIMEOUT);
+ evas_object_smart_callback_add(toast, SIGNAL_TIMEOUT,
+ _notify_timeout_cb, NULL);
content = elm_label_add(toast);
if (!content) {