forked from enlightenment/efl
elm_calendar: provides way for configuration of weekend text color
Summary: Suggest new mark_type for elm_calendar_mark_add(). The mark names are "weekend/day1", "weekend/day2". It can be used for each country. Some country can apply to "weekend/day2" to friday if day rest only a day for a week. Until now, there is no way to separate holiday, saturday and sunday. Test Plan: 1. saturday ``` struct tm t = { 0, 0, 12, 6, 0, 0, 6, 6, -1 }; elm_calendar_mark_add(obj, "weekend/day1", &t, ELM_CALENDAR_WEEKLY); ``` 2. sunday ``` struct tm t = { 0, 0, 12, 7, 0, 0, 0, 0, -1 }; elm_calendar_mark_add(obj, "weekend/day2", &t, ELM_CALENDAR_WEEKLY); ``` Reviewers: CHAN, cedric, raster Reviewed By: raster Subscribers: raster, akanad, id213sin, cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4148
This commit is contained in:
parent
72438ab2a1
commit
5e2b1dde68
|
@ -170,6 +170,16 @@ color_classes {
|
||||||
color3: 255 255 255 192;
|
color3: 255 255 255 192;
|
||||||
desc: "Disabled Day Text";
|
desc: "Disabled Day Text";
|
||||||
}
|
}
|
||||||
|
color_class { name: "calendar_day_text_weekend1";
|
||||||
|
color: 128 128 128 255;
|
||||||
|
color3: 0 0 0 128;
|
||||||
|
desc: "Weekend Day1 Text";
|
||||||
|
}
|
||||||
|
color_class { name: "calendar_day_text_weekend2";
|
||||||
|
color: 128 128 128 255;
|
||||||
|
color3: 0 0 0 128;
|
||||||
|
desc: "Weekend Day2 Text";
|
||||||
|
}
|
||||||
color_class { name: "check_text";
|
color_class { name: "check_text";
|
||||||
color: FN_COL_DEFAULT;
|
color: FN_COL_DEFAULT;
|
||||||
desc: "Text of a checkbox's label";
|
desc: "Text of a checkbox's label";
|
||||||
|
|
|
@ -11,6 +11,12 @@
|
||||||
style { name: "calendar_date_disabled_style";\
|
style { name: "calendar_date_disabled_style";\
|
||||||
base: "font="FN" font_size=10 color=#151515 style=shadow,bottom shadow_color=#ffffffc0 align=center text_class=calendar_day_text_disabled text_class=calendar_day_text_disabled";\
|
base: "font="FN" font_size=10 color=#151515 style=shadow,bottom shadow_color=#ffffffc0 align=center text_class=calendar_day_text_disabled text_class=calendar_day_text_disabled";\
|
||||||
}\
|
}\
|
||||||
|
style { name: "calendar_date_weekend1_style";\
|
||||||
|
base: "font="FN" font_size=10 color=#2020C0 style=shadow,bottom shadow_color=#ffffffc0 align=center text_class=calendar_day_text_weekend1 color_class=calendar_day_text_weekend1";\
|
||||||
|
}\
|
||||||
|
style { name: "calendar_date_weekend2_style";\
|
||||||
|
base: "font="FN" font_size=10 color=#C02020 style=shadow,bottom shadow_color=#ffffffc0 align=center text_class=calendar_day_text_weekend2 color_class=calendar_day_text_weekend2";\
|
||||||
|
}\
|
||||||
|
|
||||||
#define CAL_SPIN(_sufix, _text, _relative)\
|
#define CAL_SPIN(_sufix, _text, _relative)\
|
||||||
part { name: "left_bt"#_sufix; type: SPACER;\
|
part { name: "left_bt"#_sufix; type: SPACER;\
|
||||||
|
@ -215,6 +221,14 @@
|
||||||
inherit: "default" 0.0; \
|
inherit: "default" 0.0; \
|
||||||
text.style: "calendar_date_disabled_style"; \
|
text.style: "calendar_date_disabled_style"; \
|
||||||
} \
|
} \
|
||||||
|
description { state: "weekend/day1" 0.0; \
|
||||||
|
inherit: "default" 0.0; \
|
||||||
|
text.style: "calendar_date_weekend1_style"; \
|
||||||
|
} \
|
||||||
|
description { state: "weekend/day2" 0.0; \
|
||||||
|
inherit: "default" 0.0; \
|
||||||
|
text.style: "calendar_date_weekend2_style"; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
part { name: "cit_"#_pos".check"; mouse_events: 0; \
|
part { name: "cit_"#_pos".check"; mouse_events: 0; \
|
||||||
scale: 1; \
|
scale: 1; \
|
||||||
|
@ -324,8 +338,19 @@
|
||||||
source: "elm"; \
|
source: "elm"; \
|
||||||
action: STATE_SET "default" 0.0; \
|
action: STATE_SET "default" 0.0; \
|
||||||
target: "cit_"#_pos".check"; \
|
target: "cit_"#_pos".check"; \
|
||||||
|
after: "cit_"#_pos".weekends_clear"; \
|
||||||
after: "cit_"#_pos".holiday_clear"; \
|
after: "cit_"#_pos".holiday_clear"; \
|
||||||
} \
|
} \
|
||||||
|
program { \
|
||||||
|
name: "cit_"#_pos".weekends_clear"; \
|
||||||
|
script { \
|
||||||
|
new st[31]; \
|
||||||
|
new Float:vl; \
|
||||||
|
get_state(PART:"cit_"#_pos".text", st, 30, vl); \
|
||||||
|
if (!strcmp(st, "weekend/day1") || !strcmp(st, "weekend/day2")) \
|
||||||
|
set_state(PART:"cit_"#_pos".text", "default", 0.0); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
program { \
|
program { \
|
||||||
name: "cit_"#_pos".holiday_clear"; \
|
name: "cit_"#_pos".holiday_clear"; \
|
||||||
script { \
|
script { \
|
||||||
|
@ -355,6 +380,30 @@
|
||||||
set_state(PART:"cit_"#_pos".text", "holiday", 0.0); \
|
set_state(PART:"cit_"#_pos".text", "holiday", 0.0); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
|
program { \
|
||||||
|
name: "cit_"#_pos".weekend/day1"; \
|
||||||
|
signal: "cit_"#_pos",weekend/day1"; \
|
||||||
|
source: "elm"; \
|
||||||
|
script { \
|
||||||
|
new st[31]; \
|
||||||
|
new Float:vl; \
|
||||||
|
get_state(PART:"cit_"#_pos".text", st, 30, vl); \
|
||||||
|
if ((strcmp(st, "today")) && (strcmp(st, "holiday")) )\
|
||||||
|
set_state(PART:"cit_"#_pos".text", "weekend/day1", 0.0); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
program { \
|
||||||
|
name: "cit_"#_pos".weekend/day2"; \
|
||||||
|
signal: "cit_"#_pos",weekend/day2"; \
|
||||||
|
source: "elm"; \
|
||||||
|
script { \
|
||||||
|
new st[31]; \
|
||||||
|
new Float:vl; \
|
||||||
|
get_state(PART:"cit_"#_pos".text", st, 30, vl); \
|
||||||
|
if ((strcmp(st, "today")) && (strcmp(st, "holiday")) )\
|
||||||
|
set_state(PART:"cit_"#_pos".text", "weekend/day2", 0.0); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
group { name: "elm/calendar/base/default";
|
group { name: "elm/calendar/base/default";
|
||||||
|
|
|
@ -1293,7 +1293,7 @@ EINA_DEPRECATED EAPI Evas_Object *elm_button_icon_unset(Evas_Object *obj);
|
||||||
*
|
*
|
||||||
* @code
|
* @code
|
||||||
* struct tm t = { 0, 0, 12, 6, 0, 0, 6, 6, -1 };
|
* struct tm t = { 0, 0, 12, 6, 0, 0, 6, 6, -1 };
|
||||||
* elm_calendar_mark_add(obj, "sat", &t, ELM_CALENDAR_WEEKLY);
|
* elm_calendar_mark_add(obj, "weekend/day1", &t, ELM_CALENDAR_WEEKLY);
|
||||||
* @endcode
|
* @endcode
|
||||||
*
|
*
|
||||||
* @see elm_calendar_mark_add()
|
* @see elm_calendar_mark_add()
|
||||||
|
@ -1313,7 +1313,7 @@ EINA_DEPRECATED EAPI void elm_calendar_text_saturday_color_set(Evas_Object *obj,
|
||||||
*
|
*
|
||||||
* @code
|
* @code
|
||||||
* struct tm t = { 0, 0, 12, 7, 0, 0, 0, 0, -1 };
|
* struct tm t = { 0, 0, 12, 7, 0, 0, 0, 0, -1 };
|
||||||
* elm_calendar_mark_add(obj, "sat", &t, ELM_CALENDAR_WEEKLY);
|
* elm_calendar_mark_add(obj, "weekend/day2", &t, ELM_CALENDAR_WEEKLY);
|
||||||
* @endcode
|
* @endcode
|
||||||
*
|
*
|
||||||
* @see elm_calendar_mark_add()
|
* @see elm_calendar_mark_add()
|
||||||
|
|
Loading…
Reference in New Issue