layout: call size calculating after text_set(NULL)
authorJinYong Park <j4939.park@samsung.com>
Wed, 23 Aug 2017 04:29:14 +0000 (13:29 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Wed, 23 Aug 2017 04:29:14 +0000 (13:29 +0900)
Summary:
When text set NULL, size is not changed even text is removed.
So, fix that case logic

1. send text,hidden signal
2. remove text
3. call sizing eval to resize layout

Test Plan:
1. run elementary_test -to check
2. change value last check object
3. compare before and after

Reviewers: Jaehyun_Cho, cedric, jpeg

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

src/bin/elementary/test_check.c
src/lib/elementary/efl_ui_layout.c

index 1ee3935..6841230 100644 (file)
@@ -20,6 +20,15 @@ state_changed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
    printf("State Pointer Value: %d\n", eb);
 }
 
+static void
+state_changed_cb2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+   if (elm_check_state_get(obj) == EINA_FALSE)
+      elm_object_text_set(obj, NULL);
+   else
+      elm_object_text_set(obj, "text is visible when check state is true.");
+}
+
 void
 test_check(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
 {
@@ -106,6 +115,13 @@ test_check(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_inf
    evas_object_show(ck);
    evas_object_show(ic);
 
+   ck = elm_check_add(win);
+   elm_box_pack_end(bx, ck);
+   elm_object_text_set(ck, "text is visible when check state is true.");
+   elm_check_state_set(ck, EINA_TRUE);
+   evas_object_show(ck);
+   evas_object_smart_callback_add(ck, "changed", state_changed_cb2, NULL);
+
    evas_object_show(win);
 }
 
index b3fac74..d64f873 100644 (file)
@@ -1240,6 +1240,7 @@ _efl_ui_layout_text_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, const
                   edje_object_part_text_escaped_set
                     (wd->resize_obj, part, NULL);
                   sd->subs = eina_list_remove_list(sd->subs, l);
+                  elm_layout_sizing_eval(obj);
                   return EINA_TRUE;
                }
              else