entry: Fix multiline entry calculation deferred issue. 47/84447/1
authorYoungbok Shin <youngb.shin@samsung.com>
Mon, 24 Aug 2015 12:27:33 +0000 (21:27 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Thu, 18 Aug 2016 13:21:30 +0000 (22:21 +0900)
Calculate minimum size for multiline entry immediately in _sizing_eval.
Deferred calculation causes size calculation issues in container widgets(elm_genlist).

@tizen_fix

Change-Id: I9e5ba8027f5cb595c3654cf8c645e9912589f11b
Signed-off-by: Youngbok Shin <youngb.shin@samsung.com>
src/lib/elm_entry.c

index 8953c9b..2c5309e 100644 (file)
@@ -1780,19 +1780,25 @@ _cursor_geometry_recalc(Evas_Object *obj)
 static void
 _deferred_recalc_job(void *data)
 {
-   Evas_Coord minh = -1, resw = -1, minw = -1, fw = 0, fh = 0;
+   // TIZEN_ONLY(20150824): Fix multiline entry calculation deferred issue.
+   //Evas_Coord minh = -1, resw = -1, minw = -1, fw = 0, fh = 0;
+   //
 
    ELM_ENTRY_DATA_GET(data, sd);
 
    sd->deferred_recalc_job = NULL;
 
+   // TIZEN_ONLY(20150824): Fix multiline entry calculation deferred issue.
+   /*
    evas_object_geometry_get(sd->entry_edje, NULL, NULL, &resw, NULL);
    edje_object_size_min_restricted_calc(sd->entry_edje, &minw, &minh, resw, 0);
    elm_coords_finger_size_adjust(1, &minw, 1, &minh);
+   */
 
    /* This is a hack to workaround the way min size hints are treated.
     * If the minimum width is smaller than the restricted width, it
     * means the minimum doesn't matter. */
+   /*
    if (minw <= resw)
      {
         Evas_Coord ominw = -1;
@@ -1834,6 +1840,8 @@ _deferred_recalc_job(void *data)
              evas_object_size_hint_max_set(data, -1, -1);
           }
      }
+     */
+   //
 
    if (sd->deferred_cur)
      {
@@ -1934,6 +1942,30 @@ _elm_entry_elm_layout_sizing_eval(Eo *obj, Elm_Entry_Data *sd)
           }
         else
           {
+             // TIZEN_ONLY(20150824): Fix multiline entry calculation deferred issue.
+             if (resw > 0)
+               {
+                  Evas_Coord fw;
+
+                  edje_object_size_min_restricted_calc(sd->entry_edje, &minw, &minh, resw, 0);
+                  elm_coords_finger_size_adjust(1, &minw, 1, &minh);
+
+                  if (minw <= resw)
+                    {
+                       Evas_Coord ominw = -1;
+
+                       evas_object_size_hint_min_get(obj, &ominw, NULL);
+                       minw = ominw;
+                    }
+
+                  sd->ent_mw = minw;
+                  sd->ent_mh = minh;
+
+                  elm_coords_finger_size_adjust(1, &fw, 1, &minh);
+                  evas_object_size_hint_min_set(obj, fw, minh);
+                  evas_object_size_hint_max_set(obj, -1, -1);
+               }
+             //
              ecore_job_del(sd->deferred_recalc_job);
              sd->deferred_recalc_job =
                ecore_job_add(_deferred_recalc_job, obj);