summaryrefslogtreecommitdiff
path: root/src/common/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/utils.c')
-rw-r--r--src/common/utils.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/common/utils.c b/src/common/utils.c
index f3e7223..ed0958c 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -184,6 +184,51 @@ Evas_Object *utils_add_table(Evas_Object *parent, const char *part,
return table;
}
+Evas_Object *utils_add_notify(Evas_Object *parent, const char *text,
+ const char *noti_style, const char *label_style, int timeout)
+{
+ Evas_Object *notify, *lbl;
+
+ if (!parent) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ notify = elm_notify_add(parent);
+ if (!notify) {
+ _ERR("elm_notify_add failed.");
+ return NULL;
+ }
+
+ evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ elm_notify_align_set(notify, 0.0, 1.0);
+ elm_notify_timeout_set(notify, timeout);
+
+ if (noti_style)
+ elm_object_style_set(notify, noti_style);
+
+ lbl = elm_label_add(notify);
+ if (!lbl) {
+ _ERR("elm_label_add failed.");
+ evas_object_del(notify);
+ return NULL;
+ }
+
+ elm_object_content_set(notify, lbl);
+ evas_object_show(lbl);
+
+ if (label_style)
+ elm_object_style_set(lbl, label_style);
+
+ if (text)
+ elm_object_text_set(lbl, text);
+
+ evas_object_show(notify);
+
+ return notify;
+}
+
bool utils_launch_app(const char *appid, const char *key, const char *value)
{
app_control_h app_ctrl;