default theme: fix part names in efl/calendar

Summary:
Ref T6967
Depends on D6453

Reviewers: zmike, devilhorns

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6967

Differential Revision: https://phab.enlightenment.org/D6454
This commit is contained in:
Xavi Artigas 2018-06-29 11:32:54 -04:00 committed by Mike Blumenkrantz
parent ce9f568cc9
commit f115d878a0
2 changed files with 91 additions and 91 deletions

View File

@ -89,7 +89,7 @@
} }
#define CH(_pos) \ #define CH(_pos) \
part { name: "ch_"#_pos".base"; type: SPACER; \ part { name: "ch_"#_pos"_base"; type: SPACER; \
description { state: "default" 0.0; \ description { state: "default" 0.0; \
rel1 { \ rel1 { \
relative: (_pos % 7 / 7) 0.0; \ relative: (_pos % 7 / 7) 0.0; \
@ -101,13 +101,13 @@
} \ } \
} \ } \
} \ } \
part { name: "ch_"#_pos".text"; type: TEXT; mouse_events: 0; \ part { name: "efl.ch_"#_pos".text"; type: TEXT; mouse_events: 0; \
effect: SHADOW BOTTOM; \ effect: SHADOW BOTTOM; \
scale: 1; \ scale: 1; \
clip_to: "ch_"#_pos".clipper"; \ clip_to: "ch_"#_pos"_clipper"; \
description { state: "default" 0.0; \ description { state: "default" 0.0; \
rel1.to: "ch_"#_pos".base"; \ rel1.to: "ch_"#_pos"_base"; \
rel2.to: "ch_"#_pos".base"; \ rel2.to: "ch_"#_pos"_base"; \
text { font: FN; size: 8; \ text { font: FN; size: 8; \
min: 1 1; \ min: 1 1; \
ellipsis: -1; \ ellipsis: -1; \
@ -116,15 +116,15 @@
color_class: "calendar_weekday_text"; \ color_class: "calendar_weekday_text"; \
} \ } \
} \ } \
part { name: "ch_"#_pos".clipper"; type: RECT; \ part { name: "ch_"#_pos"_clipper"; type: RECT; \
description { state: "default" 0.0; \ description { state: "default" 0.0; \
rel1.to: "ch_"#_pos".base"; \ rel1.to: "ch_"#_pos"_base"; \
rel2.to: "ch_"#_pos".base"; \ rel2.to: "ch_"#_pos"_base"; \
} \ } \
} }
#define CIT(_pos) \ #define CIT(_pos) \
part { name: "cit_"#_pos".rect"; type: SPACER; \ part { name: "cit_"#_pos"_rect"; type: SPACER; \
description { state: "default" 0.0; \ description { state: "default" 0.0; \
rel1 { \ rel1 { \
relative: (_pos % 7 / 7) \ relative: (_pos % 7 / 7) \
@ -138,18 +138,18 @@
} \ } \
} \ } \
} \ } \
part { name: "cit_"#_pos".event"; type: RECT; repeat_events: 1; \ part { name: "cit_"#_pos"_event"; type: RECT; repeat_events: 1; \
description { state: "default" 0.0; \ description { state: "default" 0.0; \
rel1.to: "cit_"#_pos".rect"; \ rel1.to: "cit_"#_pos"_rect"; \
rel2.to: "cit_"#_pos".rect"; \ rel2.to: "cit_"#_pos"_rect"; \
color: 0 0 0 0; \ color: 0 0 0 0; \
} \ } \
} \ } \
part { name: "cit_"#_pos".pat"; mouse_events: 0; \ part { name: "cit_"#_pos"_pat"; mouse_events: 0; \
description { state: "default" 0.0; \ description { state: "default" 0.0; \
rel1.to: "cit_"#_pos".selected"; \ rel1.to: "cit_"#_pos"_selected"; \
rel1.offset: 1 1; \ rel1.offset: 1 1; \
rel2.to: "cit_"#_pos".selected"; \ rel2.to: "cit_"#_pos"_selected"; \
rel2.offset: -2 -2; \ rel2.offset: -2 -2; \
image.normal: "diagonal_stripes.png"; \ image.normal: "diagonal_stripes.png"; \
color: 255 255 255 25; \ color: 255 255 255 25; \
@ -162,10 +162,10 @@
visible: 1; \ visible: 1; \
} \ } \
} \ } \
part { name: "cit_"#_pos".selected"; mouse_events: 0; \ part { name: "cit_"#_pos"_selected"; mouse_events: 0; \
description { state: "default" 0.0; \ description { state: "default" 0.0; \
rel1.to: "cit_"#_pos".rect"; \ rel1.to: "cit_"#_pos"_rect"; \
rel2.to: "cit_"#_pos".rect"; \ rel2.to: "cit_"#_pos"_rect"; \
image.normal: "outline_glow.png"; \ image.normal: "outline_glow.png"; \
image.border: 4 4 4 4; \ image.border: 4 4 4 4; \
color_class: "calendar_day_selected"; \ color_class: "calendar_day_selected"; \
@ -176,10 +176,10 @@
visible: 1; \ visible: 1; \
} \ } \
} \ } \
part { name: "cit_"#_pos".selected2"; mouse_events: 0; \ part { name: "cit_"#_pos"_selected2"; mouse_events: 0; \
description { state: "default" 0.0; \ description { state: "default" 0.0; \
rel1.to: "cit_"#_pos".rect"; \ rel1.to: "cit_"#_pos"_rect"; \
rel2.to: "cit_"#_pos".rect"; \ rel2.to: "cit_"#_pos"_rect"; \
image.normal: "outline_glow.png"; \ image.normal: "outline_glow.png"; \
image.border: 4 4 4 4; \ image.border: 4 4 4 4; \
color: 255 255 255 128; \ color: 255 255 255 128; \
@ -191,10 +191,10 @@
visible: 1; \ visible: 1; \
} \ } \
} \ } \
part { name: "cit_"#_pos".glow"; mouse_events: 0; \ part { name: "cit_"#_pos"_glow"; mouse_events: 0; \
description { state: "default" 0.0; \ description { state: "default" 0.0; \
rel1.to: "cit_"#_pos".rect"; \ rel1.to: "cit_"#_pos"_rect"; \
rel2.to: "cit_"#_pos".rect"; \ rel2.to: "cit_"#_pos"_rect"; \
image.normal: "box_glow.png"; \ image.normal: "box_glow.png"; \
image.border: 12 12 12 12; \ image.border: 12 12 12 12; \
image.middle: 0; \ image.middle: 0; \
@ -206,11 +206,11 @@
visible: 1; \ visible: 1; \
} \ } \
} \ } \
part { name: "cit_"#_pos".text"; type: TEXTBLOCK; mouse_events: 0; \ part { name: "efl.cit_"#_pos".text"; type: TEXTBLOCK; mouse_events: 0; \
scale: 1; \ scale: 1; \
description { state: "default" 0.0; \ description { state: "default" 0.0; \
rel1.to: "cit_"#_pos".rect"; \ rel1.to: "cit_"#_pos"_rect"; \
rel2.to: "cit_"#_pos".rect"; \ rel2.to: "cit_"#_pos"_rect"; \
text.style: "efl_ui_calendar_date_style"; \ text.style: "efl_ui_calendar_date_style"; \
text.min: 1 1; \ text.min: 1 1; \
text.ellipsis: -1; \ text.ellipsis: -1; \
@ -224,16 +224,16 @@
text.style: "efl_ui_calendar_date_disabled_style"; \ text.style: "efl_ui_calendar_date_disabled_style"; \
} \ } \
} \ } \
part { name: "cit_"#_pos".check"; mouse_events: 0; \ part { name: "cit_"#_pos"_check"; mouse_events: 0; \
scale: 1; \ scale: 1; \
description { state: "default" 0.0; \ description { state: "default" 0.0; \
fixed: 1 1; \ fixed: 1 1; \
rel1 { \ rel1 { \
to: "cit_"#_pos".rect"; \ to: "cit_"#_pos"_rect"; \
relative: 0.6 0.5; \ relative: 0.6 0.5; \
} \ } \
rel2 { \ rel2 { \
to: "cit_"#_pos".rect"; \ to: "cit_"#_pos"_rect"; \
relative: 0.6 0.5; \ relative: 0.6 0.5; \
} \ } \
min: 16 16; \ min: 16 16; \
@ -249,173 +249,173 @@
visible: 1; \ visible: 1; \
} \ } \
} \ } \
part { name: "cit_"#_pos".access"; type: RECT; repeat_events: 1; \ part { name: "efl.cit_"#_pos".access"; type: RECT; repeat_events: 1; \
description { state: "default" 0.0; \ description { state: "default" 0.0; \
rel1.to: "cit_"#_pos".event"; \ rel1.to: "cit_"#_pos"_event"; \
rel2.to: "cit_"#_pos".event"; \ rel2.to: "cit_"#_pos"_event"; \
color: 0 0 0 0; \ color: 0 0 0 0; \
} \ } \
} \ } \
programs { \ programs { \
program { \ program { \
name: "cit_"#_pos".go_active"; \ name: "cit_"#_pos"_go_active"; \
signal: "cit_"#_pos",selected"; \ signal: "cit_"#_pos",selected"; \
source: "efl"; \ source: "efl"; \
action: STATE_SET "selected" 0.0; \ action: STATE_SET "selected" 0.0; \
target: "cit_"#_pos".pat"; \ target: "cit_"#_pos"_pat"; \
target: "cit_"#_pos".selected"; \ target: "cit_"#_pos"_selected"; \
} \ } \
program { \ program { \
name: "cit_"#_pos".go_passive"; \ name: "cit_"#_pos"_go_passive"; \
signal: "cit_"#_pos",unselected"; \ signal: "cit_"#_pos",unselected"; \
source: "efl"; \ source: "efl"; \
action: STATE_SET "default" 0.0; \ action: STATE_SET "default" 0.0; \
target: "cit_"#_pos".pat"; \ target: "cit_"#_pos"_pat"; \
target: "cit_"#_pos".selected"; \ target: "cit_"#_pos"_selected"; \
} \ } \
program { \ program { \
name: "cit_"#_pos".focus_highlighted"; \ name: "cit_"#_pos"_focus_highlighted"; \
signal: "cit_"#_pos",focused"; \ signal: "cit_"#_pos",focused"; \
source: "efl"; \ source: "efl"; \
script { \ script { \
set_int(item_focus_enabled, 1); \ set_int(item_focus_enabled, 1); \
set_int(last_focused_item, _pos); \ set_int(last_focused_item, _pos); \
if (get_int(win_focus_enabled) == 1) \ if (get_int(win_focus_enabled) == 1) \
set_state(PART:"cit_"#_pos".glow", "focused", 0.0); \ set_state(PART:"cit_"#_pos"_glow", "focused", 0.0); \
} \ } \
} \ } \
program { \ program { \
name: "cit_"#_pos".focus_unhighlighed"; \ name: "cit_"#_pos"_focus_unhighlighed"; \
signal: "cit_"#_pos",unfocused"; \ signal: "cit_"#_pos",unfocused"; \
source: "efl"; \ source: "efl"; \
script { \ script { \
set_int(item_focus_enabled, 0); \ set_int(item_focus_enabled, 0); \
set_state(PART:"cit_"#_pos".glow", "default", 0.0); \ set_state(PART:"cit_"#_pos"_glow", "default", 0.0); \
} \ } \
} \ } \
program { \ program { \
name: "cit_"#_pos".is_today"; \ name: "cit_"#_pos"_is_today"; \
signal: "cit_"#_pos",today"; \ signal: "cit_"#_pos",today"; \
source: "efl"; \ source: "efl"; \
action: STATE_SET "today" 0.0; \ action: STATE_SET "today" 0.0; \
target: "cit_"#_pos".text"; \ target: "efl.cit_"#_pos".text"; \
} \ } \
program { \ program { \
name: "cit_"#_pos".not_today"; \ name: "cit_"#_pos"_not_today"; \
signal: "cit_"#_pos",not_today"; \ signal: "cit_"#_pos",not_today"; \
source: "efl"; \ source: "efl"; \
action: STATE_SET "default" 0.0; \ action: STATE_SET "default" 0.0; \
target: "cit_"#_pos".text"; \ target: "efl.cit_"#_pos".text"; \
} \ } \
program { \ program { \
name: "cit_"#_pos".enable"; \ name: "cit_"#_pos"_enable"; \
signal: "cit_"#_pos",enable"; \ signal: "cit_"#_pos",enable"; \
source: "efl"; \ source: "efl"; \
script { \ script { \
new st[31]; \ new st[31]; \
new Float:vl; \ new Float:vl; \
get_state(PART:"cit_"#_pos".text", st, 30, vl); \ get_state(PART:"efl.cit_"#_pos".text", st, 30, vl); \
if (!strcmp(st, "disabled")) \ if (!strcmp(st, "disabled")) \
set_state(PART:"cit_"#_pos".text", "default", 0.0); \ set_state(PART:"efl.cit_"#_pos".text", "default", 0.0); \
} \ } \
} \ } \
program { \ program { \
name: "cit_"#_pos".disable"; \ name: "cit_"#_pos"_disable"; \
signal: "cit_"#_pos",disable"; \ signal: "cit_"#_pos",disable"; \
source: "efl"; \ source: "efl"; \
action: STATE_SET "disabled" 0.0; \ action: STATE_SET "disabled" 0.0; \
target: "cit_"#_pos".text"; \ target: "efl.cit_"#_pos".text"; \
} \ } \
program { \ program { \
source: "cit_"#_pos".clicked"; \ source: "cit_"#_pos"_clicked"; \
signal: "mouse,down,1"; \ signal: "mouse,down,1"; \
source: "cit_"#_pos".event"; \ source: "cit_"#_pos"_event"; \
action: STATE_SET "highlighted" 0.0; \ action: STATE_SET "highlighted" 0.0; \
target: "cit_"#_pos".selected2"; \ target: "cit_"#_pos"_selected2"; \
} \ } \
program { \ program { \
source: "cit_"#_pos".clicked"; \ source: "cit_"#_pos"_clicked"; \
signal: "mouse,up,1"; \ signal: "mouse,up,1"; \
source: "cit_"#_pos".event"; \ source: "cit_"#_pos"_event"; \
action: STATE_SET "default" 0.0; \ action: STATE_SET "default" 0.0; \
target: "cit_"#_pos".selected2"; \ target: "cit_"#_pos"_selected2"; \
} \ } \
program { \ program { \
source: "cit_"#_pos".clicked"; \ source: "cit_"#_pos"_clicked"; \
signal: "mouse,clicked,1"; \ signal: "mouse,clicked,1"; \
source: "cit_"#_pos".event"; \ source: "cit_"#_pos"_event"; \
action: SIGNAL_EMIT "efl,action,selected" #_pos; \ action: SIGNAL_EMIT "efl,action,selected" #_pos; \
} \ } \
program { \ program { \
name: "cit_"#_pos".clear"; \ name: "cit_"#_pos"_clear"; \
signal: "cit_"#_pos",clear"; \ signal: "cit_"#_pos",clear"; \
source: "efl"; \ source: "efl"; \
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"_weekends_clear"; \
after: "cit_"#_pos".holiday_clear"; \ after: "cit_"#_pos"_holiday_clear"; \
} \ } \
program { \ program { \
name: "cit_"#_pos".weekends_clear"; \ name: "cit_"#_pos"_weekends_clear"; \
script { \ script { \
new st[31]; \ new st[31]; \
new Float:vl; \ new Float:vl; \
get_state(PART:"cit_"#_pos".text", st, 30, vl); \ get_state(PART:"efl.cit_"#_pos".text", st, 30, vl); \
if (!strcmp(st, "weekend/day1") || !strcmp(st, "weekend/day2")) \ if (!strcmp(st, "weekend/day1") || !strcmp(st, "weekend/day2")) \
set_state(PART:"cit_"#_pos".text", "default", 0.0); \ set_state(PART:"efl.cit_"#_pos".text", "default", 0.0); \
} \ } \
} \ } \
program { \ program { \
name: "cit_"#_pos".holiday_clear"; \ name: "cit_"#_pos"_holiday_clear"; \
script { \ script { \
new st[31]; \ new st[31]; \
new Float:vl; \ new Float:vl; \
get_state(PART:"cit_"#_pos".text", st, 30, vl); \ get_state(PART:"efl.cit_"#_pos".text", st, 30, vl); \
if (!strcmp(st, "holiday")) \ if (!strcmp(st, "holiday")) \
set_state(PART:"cit_"#_pos".text", "default", 0.0); \ set_state(PART:"efl.cit_"#_pos".text", "default", 0.0); \
} \ } \
} \ } \
program { \ program { \
name: "cit_"#_pos".checked"; \ name: "cit_"#_pos"_checked"; \
signal: "cit_"#_pos",checked"; \ signal: "cit_"#_pos",checked"; \
source: "efl"; \ source: "efl"; \
action: STATE_SET "visible" 0.0; \ action: STATE_SET "visible" 0.0; \
target: "cit_"#_pos".check"; \ target: "cit_"#_pos"_check"; \
} \ } \
program { \ program { \
name: "cit_"#_pos".holiday"; \ name: "cit_"#_pos"_holiday"; \
signal: "cit_"#_pos",holiday"; \ signal: "cit_"#_pos",holiday"; \
source: "efl"; \ source: "efl"; \
script { \ script { \
new st[31]; \ new st[31]; \
new Float:vl; \ new Float:vl; \
get_state(PART:"cit_"#_pos".text", st, 30, vl); \ get_state(PART:"efl.cit_"#_pos".text", st, 30, vl); \
if (strcmp(st, "today")) \ if (strcmp(st, "today")) \
set_state(PART:"cit_"#_pos".text", "holiday", 0.0); \ set_state(PART:"efl.cit_"#_pos".text", "holiday", 0.0); \
} \ } \
} \ } \
program { \ program { \
name: "cit_"#_pos".weekend/day1"; \ name: "cit_"#_pos"_weekend/day1"; \
signal: "cit_"#_pos",weekend/day1"; \ signal: "cit_"#_pos",weekend/day1"; \
source: "efl"; \ source: "efl"; \
script { \ script { \
new st[31]; \ new st[31]; \
new Float:vl; \ new Float:vl; \
get_state(PART:"cit_"#_pos".text", st, 30, vl); \ get_state(PART:"efl.cit_"#_pos".text", st, 30, vl); \
if ((strcmp(st, "today")) && (strcmp(st, "holiday")) )\ if ((strcmp(st, "today")) && (strcmp(st, "holiday")) )\
set_state(PART:"cit_"#_pos".text", "weekend/day1", 0.0); \ set_state(PART:"efl.cit_"#_pos".text", "weekend/day1", 0.0); \
} \ } \
} \ } \
program { \ program { \
name: "cit_"#_pos".weekend/day2"; \ name: "cit_"#_pos"_weekend/day2"; \
signal: "cit_"#_pos",weekend/day2"; \ signal: "cit_"#_pos",weekend/day2"; \
source: "efl"; \ source: "efl"; \
script { \ script { \
new st[31]; \ new st[31]; \
new Float:vl; \ new Float:vl; \
get_state(PART:"cit_"#_pos".text", st, 30, vl); \ get_state(PART:"efl.cit_"#_pos".text", st, 30, vl); \
if ((strcmp(st, "today")) && (strcmp(st, "holiday")) )\ if ((strcmp(st, "today")) && (strcmp(st, "holiday")) )\
set_state(PART:"cit_"#_pos".text", "weekend/day2", 0.0); \ set_state(PART:"efl.cit_"#_pos".text", "weekend/day2", 0.0); \
} \ } \
} \ } \
} }

View File

@ -237,7 +237,7 @@ _access_calendar_item_register(Evas_Object *obj)
if ((!day) && (i == sd->first_day_it)) day = 1; if ((!day) && (i == sd->first_day_it)) day = 1;
if ((day) && (day <= maxdays)) if ((day) && (day <= maxdays))
{ {
snprintf(pname, sizeof(pname), "cit_%d.access", i); snprintf(pname, sizeof(pname), "efl.cit_%d.access", i);
ao = _elm_access_edje_object_part_object_register ao = _elm_access_edje_object_part_object_register
(obj, elm_layout_edje_get(obj), pname); (obj, elm_layout_edje_get(obj), pname);
@ -251,7 +251,7 @@ _access_calendar_item_register(Evas_Object *obj)
} }
else else
{ {
snprintf(pname, sizeof(pname), "cit_%d.access", i); snprintf(pname, sizeof(pname), "efl.cit_%d.access", i);
_elm_access_edje_object_part_object_unregister _elm_access_edje_object_part_object_unregister
(obj, elm_layout_edje_get(obj), pname); (obj, elm_layout_edje_get(obj), pname);
} }
@ -325,7 +325,7 @@ static void
_populate(Evas_Object *obj) _populate(Evas_Object *obj)
{ {
int maxdays, prev_month_maxdays, day, mon, yr, i; int maxdays, prev_month_maxdays, day, mon, yr, i;
char part[12], day_s[3]; char part[16], day_s[3];
struct tm first_day; struct tm first_day;
EFL_UI_CALENDAR_DATA_GET(obj, sd); EFL_UI_CALENDAR_DATA_GET(obj, sd);
@ -397,7 +397,7 @@ _populate(Evas_Object *obj)
snprintf(day_s, sizeof(day_s), "%d", i - sd->first_day_it - maxdays + 1); snprintf(day_s, sizeof(day_s), "%d", i - sd->first_day_it - maxdays + 1);
} }
snprintf(part, sizeof(part), "cit_%d.text", i); snprintf(part, sizeof(part), "efl.cit_%d.text", i);
elm_layout_text_set(obj, part, day_s); elm_layout_text_set(obj, part, day_s);
} }
@ -416,7 +416,7 @@ _populate(Evas_Object *obj)
static void static void
_set_headers(Evas_Object *obj) _set_headers(Evas_Object *obj)
{ {
static char part[] = "ch_0.text"; static char part[] = "efl.ch_0.text";
int i; int i;
struct tm *t; struct tm *t;
time_t temp = 259200; // the first sunday since epoch time_t temp = 259200; // the first sunday since epoch
@ -452,7 +452,7 @@ _set_headers(Evas_Object *obj)
for (i = 0; i < ELM_DAY_LAST; i++) for (i = 0; i < ELM_DAY_LAST; i++)
{ {
part[3] = i + '0'; part[7] = i + '0';
elm_layout_text_set(obj, part, sd->weekdays[(i + sd->first_week_day) % ELM_DAY_LAST]); elm_layout_text_set(obj, part, sd->weekdays[(i + sd->first_week_day) % ELM_DAY_LAST]);
} }
@ -932,8 +932,8 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
if ((!day) && (i == sd->first_day_it)) day = 1; if ((!day) && (i == sd->first_day_it)) day = 1;
if ((day) && (day <= maxdays)) if ((day) && (day <= maxdays))
{ {
char pname[14]; char pname[18];
snprintf(pname, sizeof(pname), "cit_%d.access", i); snprintf(pname, sizeof(pname), "efl.cit_%d.access", i);
_elm_access_edje_object_part_object_unregister _elm_access_edje_object_part_object_unregister
(obj, elm_layout_edje_get(obj), pname); (obj, elm_layout_edje_get(obj), pname);
@ -1283,11 +1283,11 @@ typedef struct {
EOLIAN static void EOLIAN static void
_efl_ui_calendar_item_day_number_set(Eo *obj, Efl_Ui_Calendar_Item_Data *pd, int i) _efl_ui_calendar_item_day_number_set(Eo *obj, Efl_Ui_Calendar_Item_Data *pd, int i)
{ {
char pname[14]; char pname[18];
Evas_Object *po, *o; Evas_Object *po, *o;
pd->v = i; pd->v = i;
snprintf(pname, sizeof(pname), "cit_%i.access", i); snprintf(pname, sizeof(pname), "efl.cit_%i.access", i);
o = elm_layout_edje_get(efl_parent_get(obj)); o = elm_layout_edje_get(efl_parent_get(obj));
edje_object_freeze(o); edje_object_freeze(o);