bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d2e1d430a8a5c62b5ec3a0449ae496af1dbd8861
commit d2e1d430a8a5c62b5ec3a0449ae496af1dbd8861 Author: rafspiny <[email protected]> Date: Tue Feb 18 16:12:45 2020 +0000 Adding "elm,calendar,ch_%d,weekend" and "elm,calendar,ch_%d,weekday" signals from "elm". The calendar object in elementary needs to know which days are weekdays and which are weekend days in order to properly change the state of the header's labels. This code add a signal emission from e_calendar.c when setting the header. Reviewed-by: Marcel Hollerbach <[email protected]> Differential Revision: https://phab.enlightenment.org/D11375 --- src/lib/elementary/elm_calendar.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/elm_calendar.c b/src/lib/elementary/elm_calendar.c index e6de3373c6..6edefe3c5e 100644 --- a/src/lib/elementary/elm_calendar.c +++ b/src/lib/elementary/elm_calendar.c @@ -22,6 +22,8 @@ #define ELM_CALENDAR_BUTTON_RIGHT "elm,calendar,button,right" #define ELM_CALENDAR_BUTTON_YEAR_LEFT "elm,calendar,button_year,left" #define ELM_CALENDAR_BUTTON_YEAR_RIGHT "elm,calendar,button_year,right" +#define ELM_CALENDAR_CH_WEEKEND "elm,calendar,ch_%d,weekend" +#define ELM_CALENDAR_CH_WEEKDAY "elm,calendar,ch_%d,weekday" #define ELM_CALENDAR_CH_TEXT_PART_STR "elm.ch_%d.text" #define ELM_CALENDAR_CIT_TEXT_PART_STR "elm.cit_%d.text" @@ -674,6 +676,7 @@ static void _set_headers(Evas_Object *obj) { static char part[64]; + static char emission[64]; int i; struct tm *t; time_t temp = 259200; // the first sunday since epoch @@ -710,7 +713,15 @@ _set_headers(Evas_Object *obj) for (i = 0; i < ELM_DAY_LAST; i++) { _part_name_snprintf(part, sizeof(part), obj, ELM_CALENDAR_CH_TEXT_PART_STR, i); - elm_layout_text_set(obj, part, sd->weekdays[(i + sd->first_week_day) % ELM_DAY_LAST]); + int weekday_index = (i + sd->first_week_day) % ELM_DAY_LAST; + elm_layout_text_set(obj, part, sd->weekdays[weekday_index]); + // Signaling the theme about which days are weekdays and which weekend + if (weekday_index == ELM_DAY_SATURDAY || weekday_index == ELM_DAY_SUNDAY) + _part_name_snprintf(emission, sizeof(emission), obj, ELM_CALENDAR_CH_WEEKEND, i); + else + _part_name_snprintf(emission, sizeof(emission), obj, ELM_CALENDAR_CH_WEEKDAY, i); + + elm_layout_signal_emit(obj, emission, "elm"); } sd->filling = EINA_FALSE; --
