multibuttonentry : fix box indicated item correctly in item_insert_before and item_insert_after

Summary:
If user added item with item_insert_before and item_insert_after, item was not displayed.
For this reason, fixed box indicated item correctly from reference->button to VIEW(reference).
Additionally, remove the unused variable button in _Multibuttonentry_Item struct.

Reviewers: woohyun, CHAN, cedric, jpeg

Reviewed By: CHAN

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4708
This commit is contained in:
JEONGHYUN YUN 2017-03-09 16:11:33 +09:00 committed by Jean-Philippe Andre
parent b9c8c9c08c
commit 3147066865
3 changed files with 7 additions and 4 deletions

View File

@ -184,6 +184,7 @@ _add_multibuttonentry(Evas_Object *parent)
Evas_Object *scr = NULL;
Evas_Object *mbe = NULL;
Evas_Object *btn = NULL;
Elm_Object_Item *item = NULL;
void *data = NULL;
scr = elm_scroller_add(parent);
@ -197,7 +198,10 @@ _add_multibuttonentry(Evas_Object *parent)
evas_object_size_hint_weight_set(mbe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(mbe, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_content_set(scr, mbe);
elm_multibuttonentry_item_append(mbe, "mbe", _select_cb, NULL);
item = elm_multibuttonentry_item_append(mbe, "mbe3", _select_cb, NULL);
elm_multibuttonentry_item_prepend(mbe, "mbe1", _select_cb, NULL);
elm_multibuttonentry_item_insert_before(mbe, item, "mbe2", _select_cb, NULL);
elm_multibuttonentry_item_insert_after(mbe, item, "mbe4", _select_cb, NULL);
// Add item verify callback to Multibuttonentry
elm_multibuttonentry_item_filter_append(mbe, _item_filter_cb, data);

View File

@ -891,7 +891,7 @@ _item_new(Elm_Multibuttonentry_Data *sd,
else
{
if (efl_reference)
elm_box_pack_before(sd->box, VIEW(item), reference->button);
elm_box_pack_before(sd->box, VIEW(item), VIEW(reference));
else
{
if (sd->view_state == MULTIBUTTONENTRY_VIEW_GUIDETEXT)
@ -919,7 +919,7 @@ _item_new(Elm_Multibuttonentry_Data *sd,
else
{
if (efl_reference)
elm_box_pack_after(sd->box, VIEW(item), reference->button);
elm_box_pack_after(sd->box, VIEW(item), VIEW(reference));
else
{
if (sd->view_state == MULTIBUTTONENTRY_VIEW_GUIDETEXT)

View File

@ -59,7 +59,6 @@ struct _Multibuttonentry_Item
{
Elm_Widget_Item_Data *base;
Evas_Object *button;
Evas_Coord vw, rw; // vw: visual width, real width
Eina_Bool visible : 1;
Evas_Smart_Cb func;