struct _Elm_Ctxpopup_Item
{
ELM_WIDGET_ITEM;
- const char *label;
- Evas_Object *icon;
- Evas_Smart_Cb func;
+ Elm_Object_Item *list_item;
};
struct _Widget_Data
Evas_Object *parent;
Evas_Object *base;
Evas_Object *content;
+ Evas_Object *list;
Evas_Object *box;
Evas_Object *arrow;
- Evas_Object *scr;
Evas_Object *bg;
- Eina_List *items;
Elm_Ctxpopup_Direction dir;
Elm_Ctxpopup_Direction dir_priority[4];
- Evas_Coord max_sc_w, max_sc_h;
Eina_Bool horizontal:1;
Eina_Bool visible:1;
+ Eina_Bool list_visible:1;
Eina_Bool finished:1;
};
static void _freeze_off(void *data, Evas_Object *obj, void *event_info);
static void _hold_on(void *data, Evas_Object *obj, void *event_info);
static void _hold_off(void *data, Evas_Object *obj, void *event_info);
-static void _scroller_size_reset(Widget_Data *wd);
static void _on_focus_hook(void *data, Evas_Object *obj);
static Eina_Bool _event_hook(Evas_Object *obj,
Evas_Object *src,
Evas *e,
Evas_Object *obj,
void *event_info);
-static void _item_sizing_eval(Elm_Ctxpopup_Item *item);
static void _adjust_pos_x(Evas_Coord_Point *pos,
Evas_Coord_Point *base_size,
Evas_Coord_Rectangle *hover_area);
Evas *e,
Evas_Object *obj,
void *event_info);
-static void _scroller_resize(void *data,
- Evas *e,
- Evas_Object *obj,
- void *event_info);
static void _ctxpopup_move(void *data,
Evas *e,
Evas_Object *obj,
void *event_info);
static void _restack(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _item_select_cb(void *data, Evas_Object *obj,
- const char *emission,
- const char *source);
-static void _item_icon_set(Elm_Ctxpopup_Item *item, Evas_Object *icon);
-static void _item_label_set(Elm_Ctxpopup_Item *item, const char *label);
-static void _item_new(Elm_Ctxpopup_Item *item, char *group_name);
static void _content_del(void *data,
Evas *e,
Evas_Object *obj,
void *event_info);
static void _list_del(Widget_Data *wd);
-static void _list_new(Evas_Object *obj);
-static void _remove_items(Widget_Data * wd);
static void _disable_hook(Evas_Object *obj);
static void _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source);
static void _signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data);
{
Widget_Data *wd = elm_widget_data_get(obj);
- if ((!wd) || (!wd->scr)) return;
- elm_object_scroll_freeze_push(wd->scr);
+ if ((!wd) || (!wd->list)) return;
+ elm_widget_scroll_freeze_push(wd->list);
}
static void
{
Widget_Data *wd = elm_widget_data_get(obj);
- if ((!wd) || (!wd->scr)) return;
- elm_object_scroll_freeze_pop(wd->scr);
+ if ((!wd) || (!wd->list)) return;
+ elm_widget_scroll_freeze_pop(wd->list);
}
static void
{
Widget_Data *wd = elm_widget_data_get(obj);
- if ((!wd) || (!wd->scr)) return;
- elm_object_scroll_hold_push(wd->scr);
+ if ((!wd) || (!wd->list)) return;
+ elm_widget_scroll_hold_push(wd->list);
}
static void
{
Widget_Data *wd = elm_widget_data_get(obj);
- if ((!wd) || (!wd->scr)) return;
- elm_object_scroll_hold_pop(wd->scr);
-}
-
-static void
-_scroller_size_reset(Widget_Data *wd)
-{
- wd->finished = EINA_FALSE;
- wd->max_sc_h = -1;
- wd->max_sc_w = -1;
+ if ((!wd) || (!wd->list)) return;
+ elm_widget_scroll_hold_pop(wd->list);
}
static void
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+
if (elm_widget_focus_get(obj))
{
//FIXME:
if (wd->visible)
{
- _scroller_size_reset(wd);
_sizing_eval(obj);
}
}
}
static void
-_item_sizing_eval(Elm_Ctxpopup_Item *item)
-{
- Evas_Coord min_w = -1, min_h = -1, max_w = -1, max_h = -1;
-
- if (!item) return;
-
- edje_object_size_min_restricted_calc(VIEW(item), &min_w, &min_h, min_w,
- min_h);
- evas_object_size_hint_min_set(VIEW(item), min_w, min_h);
- evas_object_size_hint_max_set(VIEW(item), max_w, max_h);
-}
-
-static void
_adjust_pos_x(Evas_Coord_Point *pos, Evas_Coord_Point *base_size,
Evas_Coord_Rectangle *hover_area)
{
if ((max_size.x > 0) && (base_size.x > max_size.x))
base_size.x = max_size.x;
+
//Limit to Min Size
evas_object_size_hint_min_get(obj, &min_size.x, &min_size.y);
{
Evas_Coord length[2];
- if(!wd->horizontal)
+ if (!wd->horizontal)
{
length[0] = pos.y - hover_area.y;
length[1] = (hover_area.y + hover_area.h) - pos.y;
evas_object_geometry_get(wd->arrow, NULL, NULL, &arrow_size.w,
&arrow_size.h);
- edje_object_part_unswallow(wd->base, wd->arrow);
+ //edje_object_part_unswallow(wd->base, wd->arrow);
switch (dir)
{
default:
break;
}
+
+ //should be here for getting accurate geometry value
+ evas_object_smart_calculate(wd->base);
}
static void
Widget_Data *wd;
wd = elm_widget_data_get(obj);
- if (wd->visible) return;
+ if (!wd->visible) return;
+ if ((wd->list) && (!wd->list_visible)) return;
switch (dir)
{
default:
break;
}
+ edje_object_signal_emit(wd->bg, "elm,state,show", "elm");
+ edje_object_signal_emit(wd->base, "elm,state,show", "elm");
}
static void
_sizing_eval(Evas_Object *obj)
{
Widget_Data *wd;
- Eina_List *elist;
- Elm_Ctxpopup_Item *item;
Evas_Coord_Rectangle rect = { 0, 0, 1, 1 };
- Evas_Coord_Point box_size = { 0, 0 };
- Evas_Coord_Point _box_size = { 0, 0 };
+ Evas_Coord_Point list_size = { 0, 0 };
wd = elm_widget_data_get(obj);
if (!wd) return;
- //Box, Scroller
- EINA_LIST_FOREACH(wd->items, elist, item)
- {
- _item_sizing_eval(item);
- evas_object_size_hint_min_get(VIEW(item), &_box_size.x, &_box_size.y);
- if (!wd->horizontal)
- {
- if (_box_size.x > box_size.x)
- box_size.x = _box_size.x;
- if (_box_size.y != -1)
- box_size.y += _box_size.y;
- }
- else
- {
- if (_box_size.x != -1)
- box_size.x += _box_size.x;
- if (_box_size.y > box_size.y)
- box_size.y = _box_size.y;
- }
- }
-
- if (!wd->content)
- {
- evas_object_size_hint_min_set(wd->box, box_size.x, box_size.y);
- evas_object_size_hint_min_set(wd->scr, box_size.x, box_size.y);
- }
-
//Base
wd->dir = _calc_base_geometry(obj, &rect);
- _show_signal_emit(obj, wd->dir);
_update_arrow(obj, wd->dir, rect);
_shift_base_by_arrow(wd->arrow, wd->dir, &rect);
- //resize scroller according to final size.
- if (!wd->content)
- evas_object_smart_calculate(wd->scr);
+ if ((wd->list) && (wd->list_visible))
+ {
+ evas_object_geometry_get(wd->list, 0, 0, &list_size.x, &list_size.y);
+ if ((list_size.x >= rect.w) || (list_size.y >= rect.h))
+ {
+ elm_list_mode_set(wd->list, ELM_LIST_COMPRESS);
+ evas_object_size_hint_min_set(wd->box, rect.w, rect.h);
+ evas_object_size_hint_min_set(obj, rect.w, rect.h);
+ }
+ }
evas_object_move(wd->base, rect.x, rect.y);
evas_object_resize(wd->base, rect.w, rect.h);
+ _show_signal_emit(obj, wd->dir);
}
static void
Evas_Coord arrow_w, arrow_h;
evas_object_geometry_get(arrow, NULL, NULL, &arrow_w, &arrow_h);
-
switch (dir)
{
case ELM_CTXPOPUP_DIRECTION_RIGHT:
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd;
- Eina_List *elist;
- Elm_Ctxpopup_Item *item;
Eina_Bool rtl;
wd = elm_widget_data_get(obj);
_elm_theme_object_set(obj, wd->arrow, "ctxpopup", "arrow",
elm_widget_style_get(obj));
- //Items
- EINA_LIST_FOREACH(wd->items, elist, item)
- {
- edje_object_mirrored_set(VIEW(item), rtl);
-
- if (item->label && item->icon)
- _elm_theme_object_set(obj, VIEW(item), "ctxpopup",
- "icon_text_style_item",
- elm_widget_style_get(obj));
- else if (item->label)
- _elm_theme_object_set(obj, VIEW(item), "ctxpopup", "text_style_item",
- elm_widget_style_get(obj));
- else if (item->icon)
- _elm_theme_object_set(obj, VIEW(item), "ctxpopup", "icon_style_item",
- elm_widget_style_get(obj));
- if (item->label)
- edje_object_part_text_set(VIEW(item), "elm.text", item->label);
-
- if (elm_widget_item_disabled_get(item))
- edje_object_signal_emit(VIEW(item), "elm,state,disabled", "elm");
-
- edje_object_message_signal_process(VIEW(item));
- }
-
- if (wd->scr)
+ if (wd->list)
{
if (!strncmp(elm_object_style_get(obj), "default", strlen("default")))
- elm_object_style_set(wd->scr, "ctxpopup");
+ elm_object_style_set(wd->list, "ctxpopup");
else
- elm_object_style_set(wd->scr, elm_object_style_get(obj));
+ elm_object_style_set(wd->list, elm_object_style_get(obj));
}
wd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
if (wd->visible)
{
- _scroller_size_reset(wd);
_sizing_eval(obj);
}
}
Widget_Data *wd;
- if (part && strcmp(part, "default")) return;
+ if ((part) && (strcmp(part, "default"))) return;
wd = elm_widget_data_get(obj);
if ((!wd) || (!content)) return;
- if (wd->items) elm_ctxpopup_clear(obj);
+ //TODO: wd->list
if (wd->content) evas_object_del(wd->content);
//Use Box
Widget_Data *wd;
Evas_Object *content;
- if (part && strcmp(part, "default")) return NULL;
+ if ((part) && (strcmp(part, "default"))) return NULL;
wd = elm_widget_data_get(obj);
if (!wd) return NULL;
content = wd->content;
- if (!content || !wd->box) return NULL;
+ if ((!content) || (!wd->box)) return NULL;
edje_object_part_unswallow(wd->base, wd->box);
elm_widget_sub_object_del(obj, wd->box);
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd;
- if (part && strcmp(part, "default")) return NULL;
+ if ((part) && (strcmp(part, "default"))) return NULL;
wd = elm_widget_data_get(obj);
if (!wd) return NULL;
return wd->content;
Widget_Data *wd;
Elm_Ctxpopup_Item *ctxpopup_it;
- if (part && strcmp(part, "default")) return;
+ if ((part) && (strcmp(part, "default"))) return;
ctxpopup_it = (Elm_Ctxpopup_Item *)it;
wd = elm_widget_data_get(WIDGET(ctxpopup_it));
if (!wd) return;
- _item_label_set(ctxpopup_it, label);
+ elm_object_item_part_text_set(ctxpopup_it->list_item, "default", label);
wd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
if (wd->visible)
{
- _scroller_size_reset(wd);
_sizing_eval(WIDGET(ctxpopup_it));
}
}
Elm_Ctxpopup_Item *ctxpopup_it;
if (part && strcmp(part, "default")) return NULL;
ctxpopup_it = (Elm_Ctxpopup_Item *)it;
- return ctxpopup_it->label;
+ return elm_object_item_part_text_get(ctxpopup_it->list_item, "default");
}
static void
Widget_Data *wd;
Elm_Ctxpopup_Item *ctxpopup_it;
- if (part && strcmp(part, "icon")) return;
+ if ((part) && (strcmp(part, "icon"))
+ && (strcmp(part, "start"))
+ && (strcmp(part, "end"))) return;
ctxpopup_it = (Elm_Ctxpopup_Item *)it;
wd = elm_widget_data_get(WIDGET(ctxpopup_it));
if (!wd) return;
- _item_icon_set(ctxpopup_it, content);
+ if ((part) && (!strcmp(part, "end")))
+ elm_object_item_part_content_set(ctxpopup_it->list_item, "end", content);
+ else
+ elm_object_item_part_content_set(ctxpopup_it->list_item, "start", content);
+
wd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
if (wd->visible)
{
- _scroller_size_reset(wd);
_sizing_eval(WIDGET(ctxpopup_it));
}
}
_item_content_get_hook(const Elm_Object_Item *it, const char *part)
{
Elm_Ctxpopup_Item *ctxpopup_it;
- if (part && strcmp(part, "icon")) return NULL;
+
+ if (part && strcmp(part, "icon") && strcmp(part, "start")
+ && strcmp(part, "end")) return NULL;
+
ctxpopup_it = (Elm_Ctxpopup_Item *)it;
- return ctxpopup_it->icon;
+
+ if (part && !strcmp(part, "end"))
+ return elm_object_item_part_content_get(ctxpopup_it->list_item, "end");
+ else
+ return elm_object_item_part_content_get(ctxpopup_it->list_item, "start");
}
static void
wd = elm_widget_data_get(WIDGET(ctxpopup_it));
if (!wd) return;
- if (elm_widget_item_disabled_get(it))
- edje_object_signal_emit(VIEW(ctxpopup_it), "elm,state,disabled", "elm");
- else
- edje_object_signal_emit(VIEW(ctxpopup_it), "elm,state,enabled", "elm");
+ elm_object_item_disabled_set(ctxpopup_it->list_item,
+ elm_widget_item_disabled_get(ctxpopup_it));
}
static void
const char *source)
{
Elm_Ctxpopup_Item *ctxpopup_it = (Elm_Ctxpopup_Item *)it;
- edje_object_signal_emit(VIEW(ctxpopup_it), emission, source);
+ elm_object_item_signal_emit(ctxpopup_it->list_item, emission, source);
}
static void
wd = elm_widget_data_get(obj);
if (!wd) return;
- if ((!wd->items) && (!wd->content)) return;
+ if ((!wd->list) && (!wd->content)) return;
+
+ if (wd->list)
+ {
+ elm_list_go(wd->list);
+ wd->visible = EINA_TRUE;
+ return;
+ }
wd->visible = EINA_TRUE;
evas_object_hide(wd->arrow);
evas_object_hide(wd->base);
- _scroller_size_reset(wd);
-
wd->visible = EINA_FALSE;
+ wd->list_visible = EINA_FALSE;
}
static void
}
static void
-_scroller_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj,
+_list_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj,
void *event_info __UNUSED__)
{
- Widget_Data *wd;
- Evas_Coord w, h;
-
- wd = elm_widget_data_get(data);
+ Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
if (!wd->visible) return;
- if (wd->finished) return;
+ if (wd->list_visible) return;
- evas_object_geometry_get(obj, 0, 0, &w, &h);
+ wd->list_visible = EINA_TRUE;
- if (w != 0 && h != 0)
- {
- if ((w <= wd->max_sc_w) && (h <= wd->max_sc_h))
- {
- _sizing_eval(data);
- wd->finished = EINA_TRUE;
- return;
- }
- }
-
- if (wd->max_sc_w < w)
- wd->max_sc_w = w;
- if (wd->max_sc_h < h)
- wd->max_sc_h = h;
-
- _sizing_eval(data);
+ evas_object_show(wd->bg);
+ evas_object_show(wd->base);
+ evas_object_show(wd->arrow);
+ _sizing_eval(obj);
}
static void
if (wd->visible)
evas_object_show(wd->arrow);
- _scroller_size_reset(wd);
_sizing_eval(obj);
}
}
static void
-_item_select_cb(void *data, Evas_Object *obj __UNUSED__,
- const char *emission __UNUSED__, const char *source __UNUSED__)
-{
- Elm_Ctxpopup_Item *item = data;
-
- if (!item) return;
- if (elm_widget_item_disabled_get(item)) return;
-
- if (item->func)
- item->func((void*)item->base.data, WIDGET(item), data);
-}
-
-static void
-_item_icon_set(Elm_Ctxpopup_Item *item, Evas_Object *icon)
-{
- if (item->icon)
- evas_object_del(item->icon);
-
- item->icon = icon;
- if (!icon) return;
-
- edje_object_part_swallow(VIEW(item), "elm.swallow.icon", item->icon);
- edje_object_message_signal_process(VIEW(item));
-}
-
-static void
-_item_label_set(Elm_Ctxpopup_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_message_signal_process(VIEW(item));
-}
-
-static void
-_item_new(Elm_Ctxpopup_Item *item, char *group_name)
-{
- Widget_Data *wd;
-
- wd = elm_widget_data_get(WIDGET(item));
- if (!wd) return;
-
- VIEW(item) = edje_object_add(evas_object_evas_get(wd->base));
- edje_object_mirrored_set(VIEW(item), elm_widget_mirrored_get(WIDGET(item)));
- _elm_theme_object_set(WIDGET(item), VIEW(item), "ctxpopup", group_name,
- elm_widget_style_get(WIDGET(item)));
- edje_object_signal_callback_add(VIEW(item), "elm,action,click", "",
- _item_select_cb, item);
- evas_object_size_hint_align_set(VIEW(item), EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(VIEW(item));
-}
-
-static void
_content_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
void *event_info __UNUSED__)
{
static void
_list_del(Widget_Data *wd)
{
- if (!wd->scr) return;
+ if (!wd->list) return;
- edje_object_part_unswallow(wd->base, wd->scr);
- evas_object_del(wd->scr);
- wd->scr = NULL;
+ edje_object_part_unswallow(wd->base, wd->box);
+ elm_box_unpack(wd->box, wd->list);
+ evas_object_del(wd->list);
+ wd->list = NULL;
wd->box = NULL;
}
-static void
-_list_new(Evas_Object *obj)
-{
- Widget_Data *wd;
- wd = elm_widget_data_get(obj);
- if (!wd) return;
-
- //scroller
- wd->scr = elm_scroller_add(obj);
- elm_object_style_set(wd->scr, "ctxpopup");
- evas_object_size_hint_align_set(wd->scr, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_RESIZE,
- _scroller_resize, obj);
- edje_object_part_swallow(wd->base, "elm.swallow.content", wd->scr);
-
- //box
- wd->box = elm_box_add(obj);
- evas_object_size_hint_weight_set(wd->box, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
-
- elm_object_content_set(wd->scr, wd->box);
- elm_ctxpopup_horizontal_set(obj, wd->horizontal);
-}
-
-static void
-_remove_items(Widget_Data *wd)
-{
- Eina_List *elist;
- Elm_Ctxpopup_Item *item;
-
- if (!wd->items) return;
-
- EINA_LIST_FOREACH(wd->items, elist, item)
- {
- if (item->label)
- eina_stringshare_del(item->label);
- if (item->icon)
- evas_object_del(item->icon);
- wd->items = eina_list_remove(wd->items, item);
- elm_widget_item_free(item);
- }
-
- wd->items = NULL;
-}
-
static Eina_Bool
_item_del_pre_hook(Elm_Object_Item *it)
{
+ Evas_Object *list;
Widget_Data *wd;
Elm_Ctxpopup_Item *ctxpopup_it = (Elm_Ctxpopup_Item *)it;
wd = elm_widget_data_get(WIDGET(ctxpopup_it));
if (!wd) return EINA_FALSE;
- if (ctxpopup_it->icon)
- evas_object_del(ctxpopup_it->icon);
- if (VIEW(ctxpopup_it))
- evas_object_del(VIEW(ctxpopup_it));
-
- eina_stringshare_del(ctxpopup_it->label);
-
- wd->items = eina_list_remove(wd->items, ctxpopup_it);
-
wd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
- if (eina_list_count(wd->items) < 1)
+ list = elm_object_item_widget_get(ctxpopup_it->list_item);
+
+ if (eina_list_count(elm_list_items_get(list)) < 2)
{
+ elm_object_item_del(ctxpopup_it->list_item);
evas_object_hide(WIDGET(ctxpopup_it));
return EINA_TRUE;
}
- if (wd->visible)
+ elm_object_item_del(ctxpopup_it->list_item);
+ if (wd->list_visible)
_sizing_eval(WIDGET(ctxpopup_it));
return EINA_TRUE;
static void
_disable_hook(Evas_Object *obj)
{
- Eina_List *l;
- Elm_Object_Item *it;
-
+ //TODO: elm_object_disabled_set(); does not ignite this part
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- EINA_LIST_FOREACH(wd->items, l, it)
- elm_object_item_disabled_set(it, elm_widget_disabled_get(obj));
+ elm_object_disabled_set(wd->list, elm_widget_disabled_get(obj));
}
static void
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- _remove_items(wd);
_list_del(wd);
wd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
}
wd->horizontal = !!horizontal;
- if ((!wd->scr) && (!wd->box))
+ if ((!wd->list))
return;
if (!horizontal)
{
- elm_box_horizontal_set(wd->box, EINA_FALSE);
- elm_scroller_bounce_set(wd->scr, EINA_FALSE, EINA_TRUE);
+ elm_list_horizontal_set(wd->list, wd->horizontal);
}
else
{
- elm_box_horizontal_set(wd->box, EINA_TRUE);
- elm_scroller_bounce_set(wd->scr, EINA_TRUE, EINA_FALSE);
+ elm_list_horizontal_set(wd->list, wd->horizontal);
}
wd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd;
- Evas_Object *content;
Elm_Ctxpopup_Item *item;
wd = elm_widget_data_get(obj);
elm_widget_item_content_get_hook_set(item, _item_content_get_hook);
elm_widget_item_signal_emit_hook_set(item, _item_signal_emit_hook);
- //The first item is appended.
- content = elm_object_content_unset(obj);
- if (content) evas_object_del(content);
-
- if (!wd->items)
- _list_new(obj);
-
- item->func = func;
- item->base.data = data;
+ if (!wd->list)
+ {
+ //The first item is appended.
+ wd->list = elm_list_add(obj);
+ elm_list_mode_set(wd->list, ELM_LIST_EXPAND);
+ elm_list_horizontal_set(wd->list, wd->horizontal);
+ evas_object_event_callback_add(wd->list, EVAS_CALLBACK_RESIZE,
+ _list_resize, obj);
+ _content_set_hook(obj, "default", wd->list);
+ }
- if (icon && label)
- _item_new(item, "icon_text_style_item");
- else if (label)
- _item_new(item, "text_style_item");
- else
- _item_new(item, "icon_style_item");
+ item->list_item = elm_list_item_append(wd->list, label, icon, NULL, func, data);
- _item_icon_set(item, icon);
- _item_label_set(item, label);
- elm_box_pack_end(wd->box, VIEW(item));
- wd->items = eina_list_append(wd->items, item);
wd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
- if (wd->visible)
- {
- _scroller_size_reset(wd);
- _sizing_eval(obj);
- }
+ if (wd->visible) _sizing_eval(obj);
return (Elm_Object_Item *)item;
}