elm_calendar: Fix header text bug.

Summary:
There is a bug. when calendar showing very first time.
the some of the headers(weekday name) is blank.

Because of elm_layout_text_set() called with NULL value.

Need to insert all of the weekday names before set text.

@fix

Test Plan:
Execute elementary_test
Open calendar sample.
See the all of the header names there.

Reviewers: cedric, jpeg, Hermet

Reviewed By: Hermet

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4290
This commit is contained in:
Woochan Lee 2016-09-13 15:13:45 +09:00 committed by Hermet Park
parent 773aad7932
commit cb15722768
1 changed files with 11 additions and 12 deletions

View File

@ -697,15 +697,8 @@ _set_headers(Evas_Object *obj)
elm_layout_freeze(obj);
sd->filling = EINA_TRUE;
if (sd->weekdays_set)
{
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]);
}
}
else
if (!sd->weekdays_set)
{
for (i = 0; i < ELM_DAY_LAST; i++)
{
@ -730,11 +723,17 @@ _set_headers(Evas_Object *obj)
_days_abbrev[i]);
}
}
part[3] = i + '0';
elm_layout_text_set(obj, part, sd->weekdays[(i + sd->first_week_day) % ELM_DAY_LAST]);
weekday += 86400; /* Advance by a day */
}
}
}
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);