summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWooHyun Jung <wh0705.jung@samsung.com>2017-12-05 11:41:54 +0900
committerSungtaek Hong <sth253.hong@samsung.com>2017-12-08 16:02:23 +0900
commitcd7961162658f38d7a8dc6115a18aee32ea95541 (patch)
treeff53bddd541bb30fe08c8a16e99efbe6d25138d8 /src
parent1f1c3b9b27d6ba6cd5359a91e187ccde4841f80c (diff)
efl_ui_calendar: apply new theme policy
Reviewers: jpeg, taxi2se Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D5578
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_calendar.c84
1 files changed, 40 insertions, 44 deletions
diff --git a/src/lib/elementary/efl_ui_calendar.c b/src/lib/elementary/efl_ui_calendar.c
index 49c325905e..492b588614 100644
--- a/src/lib/elementary/efl_ui_calendar.c
+++ b/src/lib/elementary/efl_ui_calendar.c
@@ -21,6 +21,9 @@
21#define EFL_UI_CALENDAR_BUTTON_YEAR_LEFT "elm,calendar,button_year,left" 21#define EFL_UI_CALENDAR_BUTTON_YEAR_LEFT "elm,calendar,button_year,left"
22#define EFL_UI_CALENDAR_BUTTON_YEAR_RIGHT "elm,calendar,button_year,right" 22#define EFL_UI_CALENDAR_BUTTON_YEAR_RIGHT "elm,calendar,button_year,right"
23 23
24static const char PART_NAME_DEC_BUTTON[] = "dec_button";
25static const char PART_NAME_INC_BUTTON[] = "inc_button";
26
24static const char SIG_CHANGED[] = "changed"; 27static const char SIG_CHANGED[] = "changed";
25 28
26static const Evas_Smart_Cb_Description _smart_callbacks[] = { 29static const Evas_Smart_Cb_Description _smart_callbacks[] = {
@@ -33,21 +36,20 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
33}; 36};
34 37
35static void 38static void
36_button_widget_month_inc_start_click(void *data, 39_button_widget_month_dec_start(void *data,
37 Evas_Object *obj EINA_UNUSED, 40 const Efl_Event *ev EINA_UNUSED);
38 void *event_info EINA_UNUSED); 41
39static void
40_button_widget_month_inc_start(void *data,
41 Evas_Object *obj EINA_UNUSED,
42 void *event_info EINA_UNUSED);
43static void 42static void
44_button_widget_month_dec_start_click(void *data, 43_button_widget_month_dec_start_click(void *data,
45 Evas_Object *obj EINA_UNUSED, 44 const Efl_Event *ev EINA_UNUSED);
46 void *event_info EINA_UNUSED); 45
47static void 46static void
48_button_widget_month_dec_start(void *data, 47_button_widget_month_inc_start(void *data,
49 Evas_Object *obj EINA_UNUSED, 48 const Efl_Event *ev EINA_UNUSED);
50 void *event_info EINA_UNUSED); 49
50static void
51_button_widget_month_inc_start_click(void *data,
52 const Efl_Event *ev EINA_UNUSED);
51 53
52static Eina_Bool _key_action_activate(Evas_Object *obj, const char *params); 54static Eina_Bool _key_action_activate(Evas_Object *obj, const char *params);
53 55
@@ -460,14 +462,8 @@ _set_headers(Evas_Object *obj)
460static void 462static void
461_spinner_buttons_add(Evas_Object *obj, Efl_Ui_Calendar_Data *sd) 463_spinner_buttons_add(Evas_Object *obj, Efl_Ui_Calendar_Data *sd)
462{ 464{
463 char left_buf[255] = { 0 };
464 char right_buf[255] = { 0 };
465
466 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 465 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
467 466
468 snprintf(left_buf, sizeof(left_buf), "calendar/decrease/%s", elm_object_style_get(obj));
469 snprintf(right_buf, sizeof(right_buf), "calendar/increase/%s", elm_object_style_get(obj));
470
471 if (edje_object_part_exists(wd->resize_obj, EFL_UI_CALENDAR_BUTTON_LEFT)) 467 if (edje_object_part_exists(wd->resize_obj, EFL_UI_CALENDAR_BUTTON_LEFT))
472 { 468 {
473 if (sd->dec_btn_month && efl_isa(sd->dec_btn_month, ELM_ACCESS_CLASS)) 469 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)
479 475
480 if (!sd->dec_btn_month) 476 if (!sd->dec_btn_month)
481 { 477 {
482 sd->dec_btn_month = elm_button_add(obj); 478 sd->dec_btn_month =
483 elm_button_autorepeat_set(sd->dec_btn_month, EINA_TRUE); 479 efl_add(EFL_UI_BUTTON_CLASS, obj,
484 elm_button_autorepeat_initial_timeout_set(sd->dec_btn_month, 0.5); 480 elm_widget_element_update(obj, efl_added, PART_NAME_DEC_BUTTON),
485 elm_button_autorepeat_gap_timeout_set(sd->dec_btn_month, 0.2); 481 efl_ui_autorepeat_enabled_set(efl_added, EINA_TRUE),
486 evas_object_smart_callback_add(sd->dec_btn_month, "clicked", _button_widget_month_dec_start_click, obj); 482 efl_ui_autorepeat_initial_timeout_set(efl_added, 0.5),
487 evas_object_smart_callback_add(sd->dec_btn_month, "repeated", _button_widget_month_dec_start, obj); 483 efl_ui_autorepeat_gap_timeout_set(efl_added, 0.2));
484
485 efl_event_callback_add(sd->dec_btn_month, EFL_UI_EVENT_CLICKED,
486 _button_widget_month_dec_start_click, obj);
487 efl_event_callback_add(sd->dec_btn_month, EFL_UI_EVENT_REPEATED,
488 _button_widget_month_dec_start, obj);
488 } 489 }
489
490 elm_object_style_set(sd->dec_btn_month, left_buf);
491 elm_layout_content_set(obj, EFL_UI_CALENDAR_BUTTON_LEFT, sd->dec_btn_month); 490 elm_layout_content_set(obj, EFL_UI_CALENDAR_BUTTON_LEFT, sd->dec_btn_month);
492 } 491 }
493 else if (sd->dec_btn_month && !efl_isa(sd->dec_btn_month, ELM_ACCESS_CLASS)) 492 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)
507 506
508 if (!sd->inc_btn_month) 507 if (!sd->inc_btn_month)
509 { 508 {
510 sd->inc_btn_month = elm_button_add(obj); 509 sd->inc_btn_month =
511 elm_button_autorepeat_set(sd->inc_btn_month, EINA_TRUE); 510 efl_add(EFL_UI_BUTTON_CLASS, obj,
512 elm_button_autorepeat_initial_timeout_set(sd->inc_btn_month, 0.5); 511 elm_widget_element_update(obj, efl_added, PART_NAME_INC_BUTTON),
513 elm_button_autorepeat_gap_timeout_set(sd->inc_btn_month, 0.2); 512 efl_ui_autorepeat_enabled_set(efl_added, EINA_TRUE),
514 evas_object_smart_callback_add(sd->inc_btn_month, "clicked", _button_widget_month_inc_start_click, obj); 513 efl_ui_autorepeat_initial_timeout_set(efl_added, 0.5),
515 evas_object_smart_callback_add(sd->inc_btn_month, "repeated", _button_widget_month_inc_start, obj); 514 efl_ui_autorepeat_gap_timeout_set(efl_added, 0.2));
515
516 efl_event_callback_add(sd->inc_btn_month, EFL_UI_EVENT_CLICKED,
517 _button_widget_month_inc_start_click, obj);
518 efl_event_callback_add(sd->inc_btn_month, EFL_UI_EVENT_REPEATED,
519 _button_widget_month_inc_start, obj);
516 } 520 }
517
518 elm_object_style_set(sd->inc_btn_month, right_buf);
519 elm_layout_content_set(obj, EFL_UI_CALENDAR_BUTTON_RIGHT, sd->inc_btn_month); 521 elm_layout_content_set(obj, EFL_UI_CALENDAR_BUTTON_RIGHT, sd->inc_btn_month);
520 } 522 }
521 else if (sd->inc_btn_month && !efl_isa(sd->inc_btn_month, ELM_ACCESS_CLASS)) 523 else if (sd->inc_btn_month && !efl_isa(sd->inc_btn_month, ELM_ACCESS_CLASS))
@@ -657,8 +659,7 @@ _spin_month_value(void *data)
657 659
658static void 660static void
659_button_widget_month_inc_start_click(void *data, 661_button_widget_month_inc_start_click(void *data,
660 Evas_Object *obj EINA_UNUSED, 662 const Efl_Event *ev EINA_UNUSED)
661 void *event_info EINA_UNUSED)
662{ 663{
663 EFL_UI_CALENDAR_DATA_GET(data, sd); 664 EFL_UI_CALENDAR_DATA_GET(data, sd);
664 if (sd->month_repeated) 665 if (sd->month_repeated)
@@ -674,8 +675,7 @@ _button_widget_month_inc_start_click(void *data,
674 675
675static void 676static void
676_button_widget_month_inc_start(void *data, 677_button_widget_month_inc_start(void *data,
677 Evas_Object *obj EINA_UNUSED, 678 const Efl_Event *ev EINA_UNUSED)
678 void *event_info EINA_UNUSED)
679{ 679{
680 EFL_UI_CALENDAR_DATA_GET(data, sd); 680 EFL_UI_CALENDAR_DATA_GET(data, sd);
681 681
@@ -689,8 +689,7 @@ _button_widget_month_inc_start(void *data,
689 689
690static void 690static void
691_button_widget_month_dec_start_click(void *data, 691_button_widget_month_dec_start_click(void *data,
692 Evas_Object *obj EINA_UNUSED, 692 const Efl_Event *ev EINA_UNUSED)
693 void *event_info EINA_UNUSED)
694{ 693{
695 EFL_UI_CALENDAR_DATA_GET(data, sd); 694 EFL_UI_CALENDAR_DATA_GET(data, sd);
696 if (sd->month_repeated) 695 if (sd->month_repeated)
@@ -706,8 +705,7 @@ _button_widget_month_dec_start_click(void *data,
706 705
707static void 706static void
708_button_widget_month_dec_start(void *data, 707_button_widget_month_dec_start(void *data,
709 Evas_Object *obj EINA_UNUSED, 708 const Efl_Event *ev EINA_UNUSED)
710 void *event_info EINA_UNUSED)
711{ 709{
712 EFL_UI_CALENDAR_DATA_GET(data, sd); 710 EFL_UI_CALENDAR_DATA_GET(data, sd);
713 711
@@ -1008,8 +1006,6 @@ _efl_ui_calendar_constructor_internal(Eo *obj, Efl_Ui_Calendar_Data *priv)
1008 elm_widget_theme_style_get(obj))) 1006 elm_widget_theme_style_get(obj)))
1009 CRI("Failed to set layout!"); 1007 CRI("Failed to set layout!");
1010 1008
1011 _spinner_buttons_add(obj, priv);
1012
1013 evas_object_smart_changed(obj); 1009 evas_object_smart_changed(obj);
1014 1010
1015 // ACCESS 1011 // ACCESS