Elementary migration revision 70492
[framework/uifw/elementary.git] / src / lib / elc_popup.c
index 74aada0..1013f49 100644 (file)
@@ -100,6 +100,8 @@ static void _button_remove(Evas_Object *obj, Evas_Object *content,
                            Eina_Bool delete);
 static void _popup_show(void *data, Evas *e, Evas_Object *obj,
                         void *event_info);
+static void _popup_hide(void *data, Evas *e, Evas_Object *obj,
+                        void *event_info);
 static const char SIG_BLOCK_CLICKED[] = "block,clicked";
 static const char SIG_TIMEOUT[] = "timeout";
 static const Evas_Smart_Cb_Description _signals[] = {
@@ -204,8 +206,8 @@ _theme_hook(Evas_Object *obj)
                                    "item", elm_widget_style_get(obj));
              if (item->label)
                {
-                  edje_object_part_text_set(VIEW(item), "elm.text",
-                                            item->label);
+                  edje_object_part_text_escaped_set(VIEW(item), "elm.text",
+                                                    item->label);
                   edje_object_signal_emit(VIEW(item),
                                           "elm,state,item,text,visible", "elm");
                }
@@ -1046,7 +1048,7 @@ static void
 _item_text_set(Elm_Popup_Content_Item *item, const char *label)
 {
    if (!eina_stringshare_replace(&item->label, label)) return;
-   edje_object_part_text_set(VIEW(item), "elm.text", label);
+   edje_object_part_text_escaped_set(VIEW(item), "elm.text", label);
    if (item->label)
      edje_object_signal_emit(VIEW(item),
                              "elm,state,item,text,visible", "elm");
@@ -1218,6 +1220,18 @@ _popup_show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
    evas_object_show(wd->notify);
 }
 
+static void
+_popup_hide(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
+               void *event_info __UNUSED__)
+{
+   Widget_Data *wd;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd) return;
+
+   evas_object_hide(wd->notify);
+}
+
 EAPI Evas_Object *
 elm_popup_add(Evas_Object *parent)
 {
@@ -1256,6 +1270,8 @@ elm_popup_add(Evas_Object *parent)
                                   _notify_resize, obj);
    evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _popup_show,
                                   NULL);
+   evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _popup_hide,
+                                  NULL);
    evas_object_event_callback_add(obj, EVAS_CALLBACK_RESTACK, _restack, NULL);
    wd->base = elm_layout_add(obj);
    evas_object_size_hint_weight_set(wd->base, EVAS_HINT_EXPAND,