datetime: Fixed field list arrange code. 61/105561/1
authorWoochan Lee <wc0917.lee@samsung.com>
Mon, 19 Dec 2016 04:46:18 +0000 (13:46 +0900)
committerWoochan Lee <wc0917.lee@samsung.com>
Mon, 19 Dec 2016 04:47:26 +0000 (13:47 +0900)
It was implemented in tizen_2.4.
I missed this commit before.

@tizen_fix

Change-Id: Id639c0a6024bce31448933a3806dfb44570b73f1

src/lib/elm_datetime.c

index 86134dfb16f1db3f6e67ab63c1d57c28e177054d..c2077e90b9e1f2f7e21d9788420cbcf70b9383f6 100644 (file)
@@ -228,6 +228,11 @@ _field_list_arrange(Evas_Object *obj)
 
    freeze = sd->freeze_sizing;
    sd->freeze_sizing = EINA_TRUE;
+
+   //////////////////////////////////////////////////////////////////////////////
+   //TIZEN_ONLY(20150225): Open source datetime code doesn't consider dynamically
+   //                      field sequence changing case.
+   /*
    for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++)
      {
         field = sd->field_list + idx;
@@ -241,6 +246,26 @@ _field_list_arrange(Evas_Object *obj)
         else
           evas_object_hide(elm_layout_content_unset(obj, buf));
      }
+   */
+   // remove all the content widget from the layout
+   for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++)
+     {
+        snprintf(buf, sizeof(buf), EDC_PART_FIELD_STR, idx);
+        elm_layout_content_unset(obj, buf);
+     }
+   // set as content widget or hide it depending on location
+   for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++)
+     {
+        field = sd->field_list + idx;
+        snprintf(buf, sizeof(buf), EDC_PART_FIELD_STR, field->location);
+
+        if (field->visible && field->fmt_exist)
+          elm_layout_content_set(obj, buf, field->item_obj);
+        else
+          evas_object_hide(field->item_obj);
+     }
+   //////////////////////////////////////////////////////////////////////////////
+
    sd->freeze_sizing = freeze;
 
    elm_layout_sizing_eval(obj);