taxi2se pushed a commit to branch feature/eo_theme. http://git.enlightenment.org/core/efl.git/commit/?id=20555ae125478642528aca9d59470a8d44f3991e
commit 20555ae125478642528aca9d59470a8d44f3991e Author: WooHyun Jung <wh0705.j...@samsung.com> Date: Tue Dec 5 11:41:54 2017 +0900 efl_ui_calendar: apply new theme policy Reviewers: jpeg, taxi2se Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D5578 --- data/elementary/themes/edc/efl/calendar.edc | 550 +++++++++++++++++++++++++++- src/lib/elementary/efl_ui_calendar.c | 84 ++--- 2 files changed, 589 insertions(+), 45 deletions(-) diff --git a/data/elementary/themes/edc/efl/calendar.edc b/data/elementary/themes/edc/efl/calendar.edc index c6b8276bb4..a1c8ffc5b6 100644 --- a/data/elementary/themes/edc/efl/calendar.edc +++ b/data/elementary/themes/edc/efl/calendar.edc @@ -1,3 +1,551 @@ +#define CIT_STYLES\ + style { name: "efl_ui_calendar_date_style";\ + base: "font="FN" font_size=10 color=#ffffff style=shadow,bottom shadow_color=#00000080 align=center text_class=calendar_day_text color_class=calendar_day_text";\ + }\ + style { name: "efl_ui_calendar_date_today_style";\ + base: "font="FN" font_size=10 color=#3399ff style=glow glow_color=#3399ff18 align=center text_class=calendar_day_text_today color_class=calendar_day_text_today";\ + }\ + style { name: "efl_ui_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";\ + }\ + +#define CAL_SPIN(_sufix, _text, _relative)\ + part { name: "left_bt"#_sufix; type: SPACER;\ + scale: 1;\ + description { state: "default" 0.0;\ + fixed: 1 1;\ + rel1 { to: #_relative;\ + offset: 0 0;\ + }\ + rel2 { to: #_relative;\ + offset: 0 -1;\ + }\ + align: 0.0 0.5;\ + min: 15 15;\ + max: 15 15;\ + }\ + }\ + part { name: "right_bt"#_sufix; type: RECT;\ + scale: 1;\ + description { state: "default" 0.0;\ + fixed: 1 1;\ + rel1 { to: #_relative;\ + offset: -1 0;\ + }\ + rel2 { to: #_relative;\ + offset: -1 -1;\ + }\ + align: 1.0 0.5;\ + min: 15 15;\ + max: 15 15;\ + color: 0 0 0 0;\ + }\ + }\ + part { name: "elm,calendar,button"#_sufix",left";\ + type: SWALLOW;\ + scale: 1;\ + description { state: "default" 0.0;\ + fixed: 1 1;\ + rel1.to: "left_bt"#_sufix;\ + rel2.to: "left_bt"#_sufix;\ + }\ + description { state: "rtl" 0.0;\ + inherit: "default" 0.0;\ + rel1.to: "right_bt"#_sufix;\ + rel2.to: "right_bt"#_sufix;\ + }\ + }\ + part { name: "elm,calendar,button"#_sufix",right";\ + type: SWALLOW;\ + scale: 1;\ + description { state: "default" 0.0;\ + fixed: 1 1;\ + rel1.to: "right_bt"#_sufix;\ + rel2.to: "right_bt"#_sufix;\ + }\ + description { state: "rtl" 0.0;\ + inherit: "default" 0.0;\ + rel1.to: "left_bt"#_sufix;\ + rel2.to: "left_bt"#_sufix;\ + }\ + }\ + part { name: #_text; type: TEXT; mouse_events: 0;\ + effect: SHADOW BOTTOM; \ + scale: 1;\ + description { state: "default" 0.0;\ + fixed: 1 1;\ + rel1 { relative: 1.0 0.0;\ + to: "left_bt"#_sufix;\ + }\ + rel2 { relative: 0.0 1.0;\ + to: "right_bt"#_sufix;\ + }\ + text { font: FNBD; size: 10;\ + min: 0 1;\ + text_class: "calendar_"#_text; \ + }\ + color_class: "calendar_"#_text; \ + }\ + } + +#define CH(_pos) \ + part { name: "ch_"#_pos".base"; type: SPACER; \ + description { state: "default" 0.0; \ + rel1 { \ + relative: (_pos % 7 / 7) 0.0; \ + to: "header"; \ + } \ + rel2 { \ + relative: (_pos % 7 / 7 + 1 / 7) 1.0; \ + to: "header"; \ + } \ + } \ + } \ + part { name: "ch_"#_pos".text"; type: TEXT; mouse_events: 0; \ + effect: SHADOW BOTTOM; \ + scale: 1; \ + clip_to: "ch_"#_pos".clipper"; \ + description { state: "default" 0.0; \ + rel1.to: "ch_"#_pos".base"; \ + rel2.to: "ch_"#_pos".base"; \ + text { font: FN; size: 8; \ + min: 1 1; \ + ellipsis: -1; \ + text_class: "calendar_weekday_text"; \ + } \ + color_class: "calendar_weekday_text"; \ + } \ + } \ + part { name: "ch_"#_pos".clipper"; type: RECT; \ + description { state: "default" 0.0; \ + rel1.to: "ch_"#_pos".base"; \ + rel2.to: "ch_"#_pos".base"; \ + } \ + } + +#define CIT(_pos) \ + part { name: "cit_"#_pos".rect"; type: SPACER; \ + description { state: "default" 0.0; \ + rel1 { \ + relative: (_pos % 7 / 7) \ + (_pos / 7 / 6 - _pos % 7 / 7 / 6); \ + to: "base"; \ + } \ + rel2 { \ + relative: (_pos % 7 / 7 + 1 / 7) \ + (_pos / 7 / 6 + 1 / 6 - _pos % 7 / 7 / 6); \ + to: "base"; \ + } \ + } \ + } \ + part { name: "cit_"#_pos".event"; type: RECT; repeat_events: 1; \ + description { state: "default" 0.0; \ + rel1.to: "cit_"#_pos".rect"; \ + rel2.to: "cit_"#_pos".rect"; \ + color: 0 0 0 0; \ + } \ + } \ + part { name: "cit_"#_pos".pat"; mouse_events: 0; \ + description { state: "default" 0.0; \ + rel1.to: "cit_"#_pos".selected"; \ + rel1.offset: 1 1; \ + rel2.to: "cit_"#_pos".selected"; \ + rel2.offset: -2 -2; \ + image.normal: "diagonal_stripes.png"; \ + color: 255 255 255 25; \ + TILED_PATTERN(240, 240) \ + color_class: "calendar_day_selected"; \ + visible: 0; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + part { name: "cit_"#_pos".selected"; mouse_events: 0; \ + description { state: "default" 0.0; \ + rel1.to: "cit_"#_pos".rect"; \ + rel2.to: "cit_"#_pos".rect"; \ + image.normal: "outline_glow.png"; \ + image.border: 4 4 4 4; \ + color_class: "calendar_day_selected"; \ + visible: 0; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + part { name: "cit_"#_pos".selected2"; mouse_events: 0; \ + description { state: "default" 0.0; \ + rel1.to: "cit_"#_pos".rect"; \ + rel2.to: "cit_"#_pos".rect"; \ + image.normal: "outline_glow.png"; \ + image.border: 4 4 4 4; \ + color: 255 255 255 128; \ + color_class: "calendar_day_highlighted"; \ + visible: 0; \ + } \ + description { state: "highlighted" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + part { name: "cit_"#_pos".glow"; mouse_events: 0; \ + description { state: "default" 0.0; \ + rel1.to: "cit_"#_pos".rect"; \ + rel2.to: "cit_"#_pos".rect"; \ + image.normal: "box_glow.png"; \ + image.border: 12 12 12 12; \ + image.middle: 0; \ + fill.smooth: 0; \ + visible: 0; \ + } \ + description { state: "focused" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + part { name: "cit_"#_pos".text"; type: TEXTBLOCK; mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + rel1.to: "cit_"#_pos".rect"; \ + rel2.to: "cit_"#_pos".rect"; \ + text.style: "efl_ui_calendar_date_style"; \ + text.min: 1 1; \ + text.ellipsis: -1; \ + } \ + description { state: "today" 0.0; \ + inherit: "default" 0.0; \ + text.style: "efl_ui_calendar_date_today_style"; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + text.style: "efl_ui_calendar_date_disabled_style"; \ + } \ + } \ + part { name: "cit_"#_pos".check"; mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + fixed: 1 1; \ + rel1 { \ + to: "cit_"#_pos".rect"; \ + relative: 0.6 0.5; \ + } \ + rel2 { \ + to: "cit_"#_pos".rect"; \ + relative: 0.6 0.5; \ + } \ + min: 16 16; \ + max: 16 16; \ + aspect: 1 1; \ + align: 0.0 1.0;\ + image.normal: "icon_border_remember.png"; \ + color_class: "calendar_day_checked"; \ + visible: 0; \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + part { name: "cit_"#_pos".access"; type: RECT; repeat_events: 1; \ + description { state: "default" 0.0; \ + rel1.to: "cit_"#_pos".event"; \ + rel2.to: "cit_"#_pos".event"; \ + color: 0 0 0 0; \ + } \ + } \ + programs { \ + program { \ + name: "cit_"#_pos".go_active"; \ + signal: "cit_"#_pos",selected"; \ + source: "elm"; \ + action: STATE_SET "selected" 0.0; \ + target: "cit_"#_pos".pat"; \ + target: "cit_"#_pos".selected"; \ + } \ + program { \ + name: "cit_"#_pos".go_passive"; \ + signal: "cit_"#_pos",unselected"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "cit_"#_pos".pat"; \ + target: "cit_"#_pos".selected"; \ + } \ + program { \ + name: "cit_"#_pos".focus_highlighted"; \ + signal: "cit_"#_pos",focused"; \ + source: "elm"; \ + script { \ + set_int(item_focus_enabled, 1); \ + set_int(last_focused_item, _pos); \ + if (get_int(win_focus_enabled) == 1) \ + set_state(PART:"cit_"#_pos".glow", "focused", 0.0); \ + } \ + } \ + program { \ + name: "cit_"#_pos".focus_unhighlighed"; \ + signal: "cit_"#_pos",unfocused"; \ + source: "elm"; \ + script { \ + set_int(item_focus_enabled, 0); \ + set_state(PART:"cit_"#_pos".glow", "default", 0.0); \ + } \ + } \ + program { \ + name: "cit_"#_pos".is_today"; \ + signal: "cit_"#_pos",today"; \ + source: "elm"; \ + action: STATE_SET "today" 0.0; \ + target: "cit_"#_pos".text"; \ + } \ + program { \ + name: "cit_"#_pos".not_today"; \ + signal: "cit_"#_pos",not_today"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "cit_"#_pos".text"; \ + } \ + program { \ + name: "cit_"#_pos".enable"; \ + signal: "cit_"#_pos",enable"; \ + source: "elm"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"cit_"#_pos".text", st, 30, vl); \ + if (!strcmp(st, "disabled")) \ + set_state(PART:"cit_"#_pos".text", "default", 0.0); \ + } \ + } \ + program { \ + name: "cit_"#_pos".disable"; \ + signal: "cit_"#_pos",disable"; \ + source: "elm"; \ + action: STATE_SET "disabled" 0.0; \ + target: "cit_"#_pos".text"; \ + } \ + program { \ + source: "cit_"#_pos".clicked"; \ + signal: "mouse,down,1"; \ + source: "cit_"#_pos".event"; \ + action: STATE_SET "highlighted" 0.0; \ + target: "cit_"#_pos".selected2"; \ + } \ + program { \ + source: "cit_"#_pos".clicked"; \ + signal: "mouse,up,1"; \ + source: "cit_"#_pos".event"; \ + action: STATE_SET "default" 0.0; \ + target: "cit_"#_pos".selected2"; \ + } \ + program { \ + source: "cit_"#_pos".clicked"; \ + signal: "mouse,clicked,1"; \ + source: "cit_"#_pos".event"; \ + action: SIGNAL_EMIT "elm,action,selected" #_pos; \ + } \ + program { \ + name: "cit_"#_pos".clear"; \ + signal: "cit_"#_pos",clear"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "cit_"#_pos".check"; \ + after: "cit_"#_pos".weekends_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 { \ + name: "cit_"#_pos".holiday_clear"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"cit_"#_pos".text", st, 30, vl); \ + if (!strcmp(st, "holiday")) \ + set_state(PART:"cit_"#_pos".text", "default", 0.0); \ + } \ + } \ + program { \ + name: "cit_"#_pos".checked"; \ + signal: "cit_"#_pos",checked"; \ + source: "elm"; \ + action: STATE_SET "visible" 0.0; \ + target: "cit_"#_pos".check"; \ + } \ + program { \ + name: "cit_"#_pos".holiday"; \ + signal: "cit_"#_pos",holiday"; \ + source: "elm"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"cit_"#_pos".text", st, 30, vl); \ + if (strcmp(st, "today")) \ + 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 { "efl/calendar"; - inherit: "elm/calendar/base/default"; + images.image: "sym_left_light_normal.png" COMP; + images.image: "sym_right_light_normal.png" COMP; + images.image: "sym_left_glow_normal.png" COMP; + images.image: "sym_right_glow_normal.png" COMP; + images.image: "icon_border_remember.png" COMP; + images.image: "outline_glow.png" COMP; + images.image: "box_glow.png" COMP; + images.image: "diagonal_stripes.png" COMP; + data.item: "focus_highlight" "on"; + script { + public rtl; + public win_focus_enabled; + public item_focus_enabled; + public last_focused_item; + } + styles { + CIT_STYLES + } + parts { + part { name: "bg"; type: SPACER; + description { state: "default" 0.0; + rel1.offset: 1 1; + rel2.offset: -2 -2; + } + } + part { name: "background"; type: SWALLOW; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + } + } + part { name: "spinner-base1"; type: SPACER; + description { state: "default" 0.0; + min: 24 16; + max: 999999 16; + rel1.to: "bg"; + rel2.to: "bg"; + rel2.relative: 1.0 (1/8); + align: 0.5 0.0; + } + } + part { name: "table-base"; type: SPACER; + description { state: "default" 0.0; + min: 70 60; + rel1.to_x: "bg"; + rel1.to_y: "spinner-base1"; + rel1.offset: 3 0; + rel1.relative: 0.0 1.0; + rel2.to: "bg"; + rel2.offset: -4 -4; + } + } + part { name: "header"; type: SPACER; + description { state: "default" 0.0; + rel1.to: "table-base"; + rel2.to: "table-base"; + rel2.relative: 1.0 (1/7); + align: 0.5 0.0; + min: 0 16; + } + } + part { name: "header_separator"; mouse_events: 0; + description { state: "default" 0.0; + fixed: 1 1; + rel1.to: "header"; + rel1.relative: 0.0 1.0; + rel1.offset: 0 -2; + rel2.to: "header"; + image.normal: "separator_horiz.png"; + fill.smooth: 0; + } + } + part { name: "base"; type: SPACER; + description { state: "default" 0.0; + rel1.to_x: "table-base"; + rel1.to_y: "header"; + rel1.relative: 0.0 1.0; + rel1.offset: 3 0; + rel2.to: "table-base"; + rel2.offset: -3 0; + } + } + + CAL_SPIN(,month_text, spinner-base1) + CH(0) CH(1) CH(2) CH(3) CH(4) CH(5) CH(6) + CIT(0) CIT(1) CIT(2) CIT(3) CIT(4) CIT(5) CIT(6) + CIT(7) CIT(8) CIT(9) CIT(10) CIT(11) CIT(12) CIT(13) + CIT(14) CIT(15) CIT(16) CIT(17) CIT(18) CIT(19) CIT(20) + CIT(21) CIT(22) CIT(23) CIT(24) CIT(25) CIT(26) CIT(27) + CIT(28) CIT(29) CIT(30) CIT(31) CIT(32) CIT(33) CIT(34) + CIT(35) CIT(36) CIT(37) CIT(38) CIT(39) CIT(40) CIT(41) + + } + programs { + program { + signal: "elm,action,focus_highlight,show"; + source: "elm"; + script { + set_int(win_focus_enabled, 1); + if (get_int(item_focus_enabled) == 1) { + new value[32]; + snprintf(value, 32, "cit_%d,focused", get_int(last_focused_item)); + emit(value, "elm"); + } + } + } + program { + signal: "elm,action,focus_highlight,hide"; + source: "elm"; + script { + set_int(win_focus_enabled, 0); + } + } + } +} + +#undef CAL_SPIN +#undef CIT +#undef CH + + +group { "efl/calendar/inc_button"; + inherit: "elm/button/base/calendar/increase/default"; +} + +group { "efl/calendar/dec_button"; + inherit: "elm/button/base/calendar/decrease/default"; } diff --git a/src/lib/elementary/efl_ui_calendar.c b/src/lib/elementary/efl_ui_calendar.c index 3e629a75b3..f886588776 100644 --- a/src/lib/elementary/efl_ui_calendar.c +++ b/src/lib/elementary/efl_ui_calendar.c @@ -21,6 +21,9 @@ #define EFL_UI_CALENDAR_BUTTON_YEAR_LEFT "elm,calendar,button_year,left" #define EFL_UI_CALENDAR_BUTTON_YEAR_RIGHT "elm,calendar,button_year,right" +static const char PART_NAME_DEC_BUTTON[] = "dec_button"; +static const char PART_NAME_INC_BUTTON[] = "inc_button"; + static const char SIG_CHANGED[] = "changed"; static const Evas_Smart_Cb_Description _smart_callbacks[] = { @@ -33,21 +36,20 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { }; static void -_button_widget_month_inc_start_click(void *data, - Evas_Object *obj EINA_UNUSED, - void *event_info EINA_UNUSED); -static void -_button_widget_month_inc_start(void *data, - Evas_Object *obj EINA_UNUSED, - void *event_info EINA_UNUSED); +_button_widget_month_dec_start(void *data, + const Efl_Event *ev EINA_UNUSED); + static void _button_widget_month_dec_start_click(void *data, - Evas_Object *obj EINA_UNUSED, - void *event_info EINA_UNUSED); + const Efl_Event *ev EINA_UNUSED); + static void -_button_widget_month_dec_start(void *data, - Evas_Object *obj EINA_UNUSED, - void *event_info EINA_UNUSED); +_button_widget_month_inc_start(void *data, + const Efl_Event *ev EINA_UNUSED); + +static void +_button_widget_month_inc_start_click(void *data, + const Efl_Event *ev EINA_UNUSED); static Eina_Bool _key_action_activate(Evas_Object *obj, const char *params); @@ -460,14 +462,8 @@ _set_headers(Evas_Object *obj) static void _spinner_buttons_add(Evas_Object *obj, Efl_Ui_Calendar_Data *sd) { - char left_buf[255] = { 0 }; - char right_buf[255] = { 0 }; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - snprintf(left_buf, sizeof(left_buf), "calendar/decrease/%s", elm_object_style_get(obj)); - snprintf(right_buf, sizeof(right_buf), "calendar/increase/%s", elm_object_style_get(obj)); - if (edje_object_part_exists(wd->resize_obj, EFL_UI_CALENDAR_BUTTON_LEFT)) { if (sd->dec_btn_month && efl_isa(sd->dec_btn_month, ELM_ACCESS_CLASS)) @@ -479,15 +475,18 @@ _spinner_buttons_add(Evas_Object *obj, Efl_Ui_Calendar_Data *sd) if (!sd->dec_btn_month) { - sd->dec_btn_month = elm_button_add(obj); - elm_button_autorepeat_set(sd->dec_btn_month, EINA_TRUE); - elm_button_autorepeat_initial_timeout_set(sd->dec_btn_month, 0.5); - elm_button_autorepeat_gap_timeout_set(sd->dec_btn_month, 0.2); - evas_object_smart_callback_add(sd->dec_btn_month, "clicked", _button_widget_month_dec_start_click, obj); - evas_object_smart_callback_add(sd->dec_btn_month, "repeated", _button_widget_month_dec_start, obj); + sd->dec_btn_month = + efl_add(EFL_UI_BUTTON_CLASS, obj, + elm_widget_element_update(obj, efl_added, PART_NAME_DEC_BUTTON), + efl_ui_autorepeat_enabled_set(efl_added, EINA_TRUE), + efl_ui_autorepeat_initial_timeout_set(efl_added, 0.5), + efl_ui_autorepeat_gap_timeout_set(efl_added, 0.2)); + + efl_event_callback_add(sd->dec_btn_month, EFL_UI_EVENT_CLICKED, + _button_widget_month_dec_start_click, obj); + efl_event_callback_add(sd->dec_btn_month, EFL_UI_EVENT_REPEATED, + _button_widget_month_dec_start, obj); } - - elm_object_style_set(sd->dec_btn_month, left_buf); elm_layout_content_set(obj, EFL_UI_CALENDAR_BUTTON_LEFT, sd->dec_btn_month); } else if (sd->dec_btn_month && !efl_isa(sd->dec_btn_month, ELM_ACCESS_CLASS)) @@ -507,15 +506,18 @@ _spinner_buttons_add(Evas_Object *obj, Efl_Ui_Calendar_Data *sd) if (!sd->inc_btn_month) { - sd->inc_btn_month = elm_button_add(obj); - elm_button_autorepeat_set(sd->inc_btn_month, EINA_TRUE); - elm_button_autorepeat_initial_timeout_set(sd->inc_btn_month, 0.5); - elm_button_autorepeat_gap_timeout_set(sd->inc_btn_month, 0.2); - evas_object_smart_callback_add(sd->inc_btn_month, "clicked", _button_widget_month_inc_start_click, obj); - evas_object_smart_callback_add(sd->inc_btn_month, "repeated", _button_widget_month_inc_start, obj); + sd->inc_btn_month = + efl_add(EFL_UI_BUTTON_CLASS, obj, + elm_widget_element_update(obj, efl_added, PART_NAME_INC_BUTTON), + efl_ui_autorepeat_enabled_set(efl_added, EINA_TRUE), + efl_ui_autorepeat_initial_timeout_set(efl_added, 0.5), + efl_ui_autorepeat_gap_timeout_set(efl_added, 0.2)); + + efl_event_callback_add(sd->inc_btn_month, EFL_UI_EVENT_CLICKED, + _button_widget_month_inc_start_click, obj); + efl_event_callback_add(sd->inc_btn_month, EFL_UI_EVENT_REPEATED, + _button_widget_month_inc_start, obj); } - - elm_object_style_set(sd->inc_btn_month, right_buf); elm_layout_content_set(obj, EFL_UI_CALENDAR_BUTTON_RIGHT, sd->inc_btn_month); } else if (sd->inc_btn_month && !efl_isa(sd->inc_btn_month, ELM_ACCESS_CLASS)) @@ -657,8 +659,7 @@ _spin_month_value(void *data) static void _button_widget_month_inc_start_click(void *data, - Evas_Object *obj EINA_UNUSED, - void *event_info EINA_UNUSED) + const Efl_Event *ev EINA_UNUSED) { EFL_UI_CALENDAR_DATA_GET(data, sd); if (sd->month_repeated) @@ -674,8 +675,7 @@ _button_widget_month_inc_start_click(void *data, static void _button_widget_month_inc_start(void *data, - Evas_Object *obj EINA_UNUSED, - void *event_info EINA_UNUSED) + const Efl_Event *ev EINA_UNUSED) { EFL_UI_CALENDAR_DATA_GET(data, sd); @@ -689,8 +689,7 @@ _button_widget_month_inc_start(void *data, static void _button_widget_month_dec_start_click(void *data, - Evas_Object *obj EINA_UNUSED, - void *event_info EINA_UNUSED) + const Efl_Event *ev EINA_UNUSED) { EFL_UI_CALENDAR_DATA_GET(data, sd); if (sd->month_repeated) @@ -706,8 +705,7 @@ _button_widget_month_dec_start_click(void *data, static void _button_widget_month_dec_start(void *data, - Evas_Object *obj EINA_UNUSED, - void *event_info EINA_UNUSED) + const Efl_Event *ev EINA_UNUSED) { EFL_UI_CALENDAR_DATA_GET(data, sd); @@ -1008,8 +1006,6 @@ _efl_ui_calendar_constructor_internal(Eo *obj, Efl_Ui_Calendar_Data *priv) elm_widget_theme_style_get(obj))) CRI("Failed to set layout!"); - _spinner_buttons_add(obj, priv); - evas_object_smart_changed(obj); // ACCESS --