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[] = {
"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");
}
Evas_Coord minw_box = 0, minh_box = 0;
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
Widget_Data *wd = elm_widget_data_get(obj);
+ Evas_Coord bx, by, bw, bh;
if (!wd) return;
if (wd->items)
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
elm_layout_sizing_eval(wd->base);
+
+ // hack hack hack. this widget needs a ... redo.
+ evas_object_geometry_get(wd->base, &bx, &by, &bw, &bh);
+ evas_object_resize(obj, bw, bh);
+ evas_object_move(obj, bx, by);
}
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");
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)
{
_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,