diff options
author | JEONGHYUN YUN <jh0506.yun@samsung.com> | 2017-03-09 16:11:33 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-03-09 16:11:34 +0900 |
commit | 3147066865907479d928d1e7958731d347589d85 (patch) | |
tree | e0deb46175bb4dd29da58eebde99d95a33cb4039 | |
parent | b9c8c9c08c88734b9d9e83c8b1247f9d19190432 (diff) |
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
-rw-r--r-- | src/bin/elementary/test_multibuttonentry.c | 6 | ||||
-rw-r--r-- | src/lib/elementary/elc_multibuttonentry.c | 4 | ||||
-rw-r--r-- | src/lib/elementary/elm_widget_multibuttonentry.h | 1 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/bin/elementary/test_multibuttonentry.c b/src/bin/elementary/test_multibuttonentry.c index e9738f3cf4..cea77e8ad8 100644 --- a/src/bin/elementary/test_multibuttonentry.c +++ b/src/bin/elementary/test_multibuttonentry.c | |||
@@ -184,6 +184,7 @@ _add_multibuttonentry(Evas_Object *parent) | |||
184 | Evas_Object *scr = NULL; | 184 | Evas_Object *scr = NULL; |
185 | Evas_Object *mbe = NULL; | 185 | Evas_Object *mbe = NULL; |
186 | Evas_Object *btn = NULL; | 186 | Evas_Object *btn = NULL; |
187 | Elm_Object_Item *item = NULL; | ||
187 | void *data = NULL; | 188 | void *data = NULL; |
188 | 189 | ||
189 | scr = elm_scroller_add(parent); | 190 | scr = elm_scroller_add(parent); |
@@ -197,7 +198,10 @@ _add_multibuttonentry(Evas_Object *parent) | |||
197 | evas_object_size_hint_weight_set(mbe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); | 198 | evas_object_size_hint_weight_set(mbe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); |
198 | evas_object_size_hint_align_set(mbe, EVAS_HINT_FILL, EVAS_HINT_FILL); | 199 | evas_object_size_hint_align_set(mbe, EVAS_HINT_FILL, EVAS_HINT_FILL); |
199 | elm_object_content_set(scr, mbe); | 200 | elm_object_content_set(scr, mbe); |
200 | elm_multibuttonentry_item_append(mbe, "mbe", _select_cb, NULL); | 201 | item = elm_multibuttonentry_item_append(mbe, "mbe3", _select_cb, NULL); |
202 | elm_multibuttonentry_item_prepend(mbe, "mbe1", _select_cb, NULL); | ||
203 | elm_multibuttonentry_item_insert_before(mbe, item, "mbe2", _select_cb, NULL); | ||
204 | elm_multibuttonentry_item_insert_after(mbe, item, "mbe4", _select_cb, NULL); | ||
201 | 205 | ||
202 | // Add item verify callback to Multibuttonentry | 206 | // Add item verify callback to Multibuttonentry |
203 | elm_multibuttonentry_item_filter_append(mbe, _item_filter_cb, data); | 207 | elm_multibuttonentry_item_filter_append(mbe, _item_filter_cb, data); |
diff --git a/src/lib/elementary/elc_multibuttonentry.c b/src/lib/elementary/elc_multibuttonentry.c index 729fa4133f..29a4c1ed8a 100644 --- a/src/lib/elementary/elc_multibuttonentry.c +++ b/src/lib/elementary/elc_multibuttonentry.c | |||
@@ -891,7 +891,7 @@ _item_new(Elm_Multibuttonentry_Data *sd, | |||
891 | else | 891 | else |
892 | { | 892 | { |
893 | if (efl_reference) | 893 | if (efl_reference) |
894 | elm_box_pack_before(sd->box, VIEW(item), reference->button); | 894 | elm_box_pack_before(sd->box, VIEW(item), VIEW(reference)); |
895 | else | 895 | else |
896 | { | 896 | { |
897 | if (sd->view_state == MULTIBUTTONENTRY_VIEW_GUIDETEXT) | 897 | if (sd->view_state == MULTIBUTTONENTRY_VIEW_GUIDETEXT) |
@@ -919,7 +919,7 @@ _item_new(Elm_Multibuttonentry_Data *sd, | |||
919 | else | 919 | else |
920 | { | 920 | { |
921 | if (efl_reference) | 921 | if (efl_reference) |
922 | elm_box_pack_after(sd->box, VIEW(item), reference->button); | 922 | elm_box_pack_after(sd->box, VIEW(item), VIEW(reference)); |
923 | else | 923 | else |
924 | { | 924 | { |
925 | if (sd->view_state == MULTIBUTTONENTRY_VIEW_GUIDETEXT) | 925 | if (sd->view_state == MULTIBUTTONENTRY_VIEW_GUIDETEXT) |
diff --git a/src/lib/elementary/elm_widget_multibuttonentry.h b/src/lib/elementary/elm_widget_multibuttonentry.h index d996a438e2..87b90d6892 100644 --- a/src/lib/elementary/elm_widget_multibuttonentry.h +++ b/src/lib/elementary/elm_widget_multibuttonentry.h | |||
@@ -59,7 +59,6 @@ struct _Multibuttonentry_Item | |||
59 | { | 59 | { |
60 | Elm_Widget_Item_Data *base; | 60 | Elm_Widget_Item_Data *base; |
61 | 61 | ||
62 | Evas_Object *button; | ||
63 | Evas_Coord vw, rw; // vw: visual width, real width | 62 | Evas_Coord vw, rw; // vw: visual width, real width |
64 | Eina_Bool visible : 1; | 63 | Eina_Bool visible : 1; |
65 | Evas_Smart_Cb func; | 64 | Evas_Smart_Cb func; |