multibuttonentry : fix box indicated item correctly in item_insert_before and item_in... 15/118215/1 accepted/tizen/common/20170309.175643 accepted/tizen/ivi/20170310.031716 accepted/tizen/mobile/20170310.031417 accepted/tizen/tv/20170310.031535 accepted/tizen/unified/20170310.080545 accepted/tizen/wearable/20170310.031635 submit/tizen/20170309.095236 submit/tizen_unified/20170310.011402
authorJEONGHYUN YUN <jh0506.yun@samsung.com>
Thu, 9 Mar 2017 07:46:23 +0000 (16:46 +0900)
committerJEONGHYUN YUN <jh0506.yun@samsung.com>
Thu, 9 Mar 2017 07:47:48 +0000 (16:47 +0900)
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, jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4708

Change-Id: Idbc0867bec31e25e6622fe6e7967c774513f860d
Signed-off-by: JEONGHYUN YUN <jh0506.yun@samsung.com>
src/bin/test_multibuttonentry.c
src/lib/elc_multibuttonentry.c
src/lib/elm_widget_multibuttonentry.h

index 41030ed..6780081 100644 (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);
index a22fca7..b6d6804 100644 (file)
@@ -972,7 +972,7 @@ _item_new(Elm_Multibuttonentry_Data *sd,
         else
           {
              if (eo_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)
@@ -1000,7 +1000,7 @@ _item_new(Elm_Multibuttonentry_Data *sd,
         else
           {
              if (eo_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)
index 89d5aca..f91efdb 100644 (file)
@@ -60,7 +60,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;