raster pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=5fa9297e41e7f00d7b485eb82673eb8746ad4031

commit 5fa9297e41e7f00d7b485eb82673eb8746ad4031
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Wed Feb 19 19:25:32 2014 +0900

    calendar - fix unstable calc complaint
    
    thios fixes T951
---
 src/lib/elm_calendar.c        | 11 ++++++++++-
 src/lib/elm_widget_calendar.h |  1 +
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/lib/elm_calendar.c b/src/lib/elm_calendar.c
index 9e58ef7..690c466 100644
--- a/src/lib/elm_calendar.c
+++ b/src/lib/elm_calendar.c
@@ -70,8 +70,10 @@ _elm_calendar_smart_sizing_eval(Eo *obj, void *_pd 
EINA_UNUSED, va_list *list EI
 
 {
    Evas_Coord minw = -1, minh = -1;
+   ELM_CALENDAR_DATA_GET(obj, sd);
    ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
 
+   if (sd->filling) return;
    // 7x8 (1 month+year, days, 6 dates.)
    elm_coords_finger_size_adjust(7, &minw, 8, &minh);
    edje_object_size_min_restricted_calc
@@ -214,6 +216,7 @@ _set_month_year(Elm_Calendar_Smart_Data *sd)
 {
    char *buf;
 
+   sd->filling = EINA_TRUE;
    if (sd->double_spinners) /* theme has spinner for year */
      {
         buf = _format_year(&sd->shown_time);
@@ -235,7 +238,7 @@ _set_month_year(Elm_Calendar_Smart_Data *sd)
         free(buf);
      }
    else elm_layout_text_set(sd->obj, "month_text", "");
-
+   sd->filling = EINA_FALSE;
 }
 
 static char *
@@ -356,6 +359,7 @@ _populate(Evas_Object *obj)
 
    elm_layout_freeze(obj);
 
+   sd->filling = EINA_FALSE;
    if (sd->today_it > 0) _not_today(sd);
 
    maxdays = _maxdays_get(&sd->shown_time);
@@ -363,6 +367,7 @@ _populate(Evas_Object *obj)
    yr = sd->shown_time.tm_year;
 
    _set_month_year(sd);
+   sd->filling = EINA_TRUE;
 
    /* Set days */
    day = 0;
@@ -524,8 +529,10 @@ _populate(Evas_Object *obj)
              break;
           }
      }
+   sd->filling = EINA_FALSE;
 
    elm_layout_thaw(obj);
+   elm_layout_sizing_eval(obj);
 }
 
 static void
@@ -537,12 +544,14 @@ _set_headers(Evas_Object *obj)
 
    elm_layout_freeze(obj);
 
+   sd->filling = EINA_TRUE;
    for (i = 0; i < ELM_DAY_LAST; i++)
      {
         part[3] = i + '0';
         elm_layout_text_set
           (obj, part, sd->weekdays[(i + sd->first_week_day) % ELM_DAY_LAST]);
      }
+   sd->filling = EINA_FALSE;
 
    elm_layout_thaw(obj);
 }
diff --git a/src/lib/elm_widget_calendar.h b/src/lib/elm_widget_calendar.h
index dd35039..1b2d9bc 100644
--- a/src/lib/elm_widget_calendar.h
+++ b/src/lib/elm_widget_calendar.h
@@ -51,6 +51,7 @@ struct _Elm_Calendar_Smart_Data
 
    Eina_Bool                selected : 1;
    Eina_Bool                double_spinners : 1;
+   Eina_Bool                filling : 1;
 };
 
 struct _Elm_Calendar_Mark

-- 


Reply via email to