multibuttonentry: fix internal entry be an orphan when editable set API called.
authorwoochan lee <wc0917.lee@samsung.com>
Fri, 30 Oct 2015 05:52:00 +0000 (06:52 +0100)
committerCedric BAIL <cedric@osg.samsung.com>
Fri, 30 Oct 2015 06:05:12 +0000 (07:05 +0100)
Summary:
When user called "elm_multibuttonetnry_editable_set()" API as false.
the internal entry will be unpacked from box.

Then called that API as true again.
the internal entry just show without box packed.

Also, editable set API should not work in MBE shrink mode.

Test Plan:
Alternately Call elm_multibuttonentry_ediable_set API as true, false.
Then check the internal entry state.

Reviewers: Hermet, cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/elc_multibuttonentry.c

index 99305b164c10777bfb20810053133af8d79708b4..3b4a2dbb9ffae83aca0b13067d333b7e4600f7f6 100644 (file)
@@ -1745,8 +1745,11 @@ _elm_multibuttonentry_editable_set(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Dat
    if (sd->editable == editable) return;
    sd->editable = editable;
 
-   if (sd->editable)
-     evas_object_show(sd->entry);
+   if (sd->editable && (sd->view_state != MULTIBUTTONENTRY_VIEW_SHRINK))
+     {
+        elm_box_pack_end(sd->box, sd->entry);
+        evas_object_show(sd->entry);
+     }
    else
      {
         elm_box_unpack(sd->box, sd->entry);