summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWooHyun Jung <wh0705.jung@samsung.com>2017-12-05 11:41:54 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-12-06 17:35:21 +0900
commitcafc6bfc7684de689b8f14dbf8126eebeca4dd20 (patch)
treea85bae0d6d896cd5312c008a76ec09a189111f10
parent1e5eb3e3e8eb6d4c24737a9f39592a0839bf8aa3 (diff)
efl_ui_calendar: apply new theme policy
Reviewers: jpeg, taxi2se Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D5578
-rw-r--r--data/elementary/themes/edc/efl/calendar.edc550
-rw-r--r--src/lib/elementary/efl_ui_calendar.c84
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 @@
1#define CIT_STYLES\
2 style { name: "efl_ui_calendar_date_style";\
3 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";\
4 }\
5 style { name: "efl_ui_calendar_date_today_style";\
6 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";\
7 }\
8 style { name: "efl_ui_calendar_date_disabled_style";\
9 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";\
10 }\
11
12#define CAL_SPIN(_sufix, _text, _relative)\
13 part { name: "left_bt"#_sufix; type: SPACER;\
14 scale: 1;\
15 description { state: "default" 0.0;\
16 fixed: 1 1;\
17 rel1 { to: #_relative;\
18 offset: 0 0;\
19 }\
20 rel2 { to: #_relative;\
21 offset: 0 -1;\
22 }\
23 align: 0.0 0.5;\
24 min: 15 15;\
25 max: 15 15;\
26 }\
27 }\
28 part { name: "right_bt"#_sufix; type: RECT;\
29 scale: 1;\
30 description { state: "default" 0.0;\
31 fixed: 1 1;\
32 rel1 { to: #_relative;\
33 offset: -1 0;\
34 }\
35 rel2 { to: #_relative;\
36 offset: -1 -1;\
37 }\
38 align: 1.0 0.5;\
39 min: 15 15;\
40 max: 15 15;\
41 color: 0 0 0 0;\
42 }\
43 }\
44 part { name: "elm,calendar,button"#_sufix",left";\
45 type: SWALLOW;\
46 scale: 1;\
47 description { state: "default" 0.0;\
48 fixed: 1 1;\
49 rel1.to: "left_bt"#_sufix;\
50 rel2.to: "left_bt"#_sufix;\
51 }\
52 description { state: "rtl" 0.0;\
53 inherit: "default" 0.0;\
54 rel1.to: "right_bt"#_sufix;\
55 rel2.to: "right_bt"#_sufix;\
56 }\
57 }\
58 part { name: "elm,calendar,button"#_sufix",right";\
59 type: SWALLOW;\
60 scale: 1;\
61 description { state: "default" 0.0;\
62 fixed: 1 1;\
63 rel1.to: "right_bt"#_sufix;\
64 rel2.to: "right_bt"#_sufix;\
65 }\
66 description { state: "rtl" 0.0;\
67 inherit: "default" 0.0;\
68 rel1.to: "left_bt"#_sufix;\
69 rel2.to: "left_bt"#_sufix;\
70 }\
71 }\
72 part { name: #_text; type: TEXT; mouse_events: 0;\
73 effect: SHADOW BOTTOM; \
74 scale: 1;\
75 description { state: "default" 0.0;\
76 fixed: 1 1;\
77 rel1 { relative: 1.0 0.0;\
78 to: "left_bt"#_sufix;\
79 }\
80 rel2 { relative: 0.0 1.0;\
81 to: "right_bt"#_sufix;\
82 }\
83 text { font: FNBD; size: 10;\
84 min: 0 1;\
85 text_class: "calendar_"#_text; \
86 }\
87 color_class: "calendar_"#_text; \
88 }\
89 }
90
91#define CH(_pos) \
92 part { name: "ch_"#_pos".base"; type: SPACER; \
93 description { state: "default" 0.0; \
94 rel1 { \
95 relative: (_pos % 7 / 7) 0.0; \
96 to: "header"; \
97 } \
98 rel2 { \
99 relative: (_pos % 7 / 7 + 1 / 7) 1.0; \
100 to: "header"; \
101 } \
102 } \
103 } \
104 part { name: "ch_"#_pos".text"; type: TEXT; mouse_events: 0; \
105 effect: SHADOW BOTTOM; \
106 scale: 1; \
107 clip_to: "ch_"#_pos".clipper"; \
108 description { state: "default" 0.0; \
109 rel1.to: "ch_"#_pos".base"; \
110 rel2.to: "ch_"#_pos".base"; \
111 text { font: FN; size: 8; \
112 min: 1 1; \
113 ellipsis: -1; \
114 text_class: "calendar_weekday_text"; \
115 } \
116 color_class: "calendar_weekday_text"; \
117 } \
118 } \
119 part { name: "ch_"#_pos".clipper"; type: RECT; \
120 description { state: "default" 0.0; \
121 rel1.to: "ch_"#_pos".base"; \
122 rel2.to: "ch_"#_pos".base"; \
123 } \
124 }
125
126#define CIT(_pos) \
127 part { name: "cit_"#_pos".rect"; type: SPACER; \
128 description { state: "default" 0.0; \
129 rel1 { \
130 relative: (_pos % 7 / 7) \
131 (_pos / 7 / 6 - _pos % 7 / 7 / 6); \
132 to: "base"; \
133 } \
134 rel2 { \
135 relative: (_pos % 7 / 7 + 1 / 7) \
136 (_pos / 7 / 6 + 1 / 6 - _pos % 7 / 7 / 6); \
137 to: "base"; \
138 } \
139 } \
140 } \
141 part { name: "cit_"#_pos".event"; type: RECT; repeat_events: 1; \
142 description { state: "default" 0.0; \
143 rel1.to: "cit_"#_pos".rect"; \
144 rel2.to: "cit_"#_pos".rect"; \
145 color: 0 0 0 0; \
146 } \
147 } \
148 part { name: "cit_"#_pos".pat"; mouse_events: 0; \
149 description { state: "default" 0.0; \
150 rel1.to: "cit_"#_pos".selected"; \
151 rel1.offset: 1 1; \
152 rel2.to: "cit_"#_pos".selected"; \
153 rel2.offset: -2 -2; \
154 image.normal: "diagonal_stripes.png"; \
155 color: 255 255 255 25; \
156 TILED_PATTERN(240, 240) \
157 color_class: "calendar_day_selected"; \
158 visible: 0; \
159 } \
160 description { state: "selected" 0.0; \
161 inherit: "default" 0.0; \
162 visible: 1; \
163 } \
164 } \
165 part { name: "cit_"#_pos".selected"; mouse_events: 0; \
166 description { state: "default" 0.0; \
167 rel1.to: "cit_"#_pos".rect"; \
168 rel2.to: "cit_"#_pos".rect"; \
169 image.normal: "outline_glow.png"; \
170 image.border: 4 4 4 4; \
171 color_class: "calendar_day_selected"; \
172 visible: 0; \
173 } \
174 description { state: "selected" 0.0; \
175 inherit: "default" 0.0; \
176 visible: 1; \
177 } \
178 } \
179 part { name: "cit_"#_pos".selected2"; mouse_events: 0; \
180 description { state: "default" 0.0; \
181 rel1.to: "cit_"#_pos".rect"; \
182 rel2.to: "cit_"#_pos".rect"; \
183 image.normal: "outline_glow.png"; \
184 image.border: 4 4 4 4; \
185 color: 255 255 255 128; \
186 color_class: "calendar_day_highlighted"; \
187 visible: 0; \
188 } \
189 description { state: "highlighted" 0.0; \
190 inherit: "default" 0.0; \
191 visible: 1; \
192 } \
193 } \
194 part { name: "cit_"#_pos".glow"; mouse_events: 0; \
195 description { state: "default" 0.0; \
196 rel1.to: "cit_"#_pos".rect"; \
197 rel2.to: "cit_"#_pos".rect"; \
198 image.normal: "box_glow.png"; \
199 image.border: 12 12 12 12; \
200 image.middle: 0; \
201 fill.smooth: 0; \
202 visible: 0; \
203 } \
204 description { state: "focused" 0.0; \
205 inherit: "default" 0.0; \
206 visible: 1; \
207 } \
208 } \
209 part { name: "cit_"#_pos".text"; type: TEXTBLOCK; mouse_events: 0; \
210 scale: 1; \
211 description { state: "default" 0.0; \
212 rel1.to: "cit_"#_pos".rect"; \
213 rel2.to: "cit_"#_pos".rect"; \
214 text.style: "efl_ui_calendar_date_style"; \
215 text.min: 1 1; \
216 text.ellipsis: -1; \
217 } \
218 description { state: "today" 0.0; \
219 inherit: "default" 0.0; \
220 text.style: "efl_ui_calendar_date_today_style"; \
221 } \
222 description { state: "disabled" 0.0; \
223 inherit: "default" 0.0; \
224 text.style: "efl_ui_calendar_date_disabled_style"; \
225 } \
226 } \
227 part { name: "cit_"#_pos".check"; mouse_events: 0; \
228 scale: 1; \
229 description { state: "default" 0.0; \
230 fixed: 1 1; \
231 rel1 { \
232 to: "cit_"#_pos".rect"; \
233 relative: 0.6 0.5; \
234 } \
235 rel2 { \
236 to: "cit_"#_pos".rect"; \
237 relative: 0.6 0.5; \
238 } \
239 min: 16 16; \
240 max: 16 16; \
241 aspect: 1 1; \
242 align: 0.0 1.0;\
243 image.normal: "icon_border_remember.png"; \
244 color_class: "calendar_day_checked"; \
245 visible: 0; \
246 } \
247 description { state: "visible" 0.0; \
248 inherit: "default" 0.0; \
249 visible: 1; \
250 } \
251 } \
252 part { name: "cit_"#_pos".access"; type: RECT; repeat_events: 1; \
253 description { state: "default" 0.0; \
254 rel1.to: "cit_"#_pos".event"; \
255 rel2.to: "cit_"#_pos".event"; \
256 color: 0 0 0 0; \
257 } \
258 } \
259 programs { \
260 program { \
261 name: "cit_"#_pos".go_active"; \
262 signal: "cit_"#_pos",selected"; \
263 source: "elm"; \
264 action: STATE_SET "selected" 0.0; \
265 target: "cit_"#_pos".pat"; \
266 target: "cit_"#_pos".selected"; \
267 } \
268 program { \
269 name: "cit_"#_pos".go_passive"; \
270 signal: "cit_"#_pos",unselected"; \
271 source: "elm"; \
272 action: STATE_SET "default" 0.0; \
273 target: "cit_"#_pos".pat"; \
274 target: "cit_"#_pos".selected"; \
275 } \
276 program { \
277 name: "cit_"#_pos".focus_highlighted"; \
278 signal: "cit_"#_pos",focused"; \
279 source: "elm"; \
280 script { \
281 set_int(item_focus_enabled, 1); \
282 set_int(last_focused_item, _pos); \
283 if (get_int(win_focus_enabled) == 1) \
284 set_state(PART:"cit_"#_pos".glow", "focused", 0.0); \
285 } \
286 } \
287 program { \
288 name: "cit_"#_pos".focus_unhighlighed"; \
289 signal: "cit_"#_pos",unfocused"; \
290 source: "elm"; \
291 script { \
292 set_int(item_focus_enabled, 0); \
293 set_state(PART:"cit_"#_pos".glow", "default", 0.0); \
294 } \
295 } \
296 program { \
297 name: "cit_"#_pos".is_today"; \
298 signal: "cit_"#_pos",today"; \
299 source: "elm"; \
300 action: STATE_SET "today" 0.0; \
301 target: "cit_"#_pos".text"; \
302 } \
303 program { \
304 name: "cit_"#_pos".not_today"; \
305 signal: "cit_"#_pos",not_today"; \
306 source: "elm"; \
307 action: STATE_SET "default" 0.0; \
308 target: "cit_"#_pos".text"; \
309 } \
310 program { \
311 name: "cit_"#_pos".enable"; \
312 signal: "cit_"#_pos",enable"; \
313 source: "elm"; \
314 script { \
315 new st[31]; \
316 new Float:vl; \
317 get_state(PART:"cit_"#_pos".text", st, 30, vl); \
318 if (!strcmp(st, "disabled")) \
319 set_state(PART:"cit_"#_pos".text", "default", 0.0); \
320 } \
321 } \
322 program { \
323 name: "cit_"#_pos".disable"; \
324 signal: "cit_"#_pos",disable"; \
325 source: "elm"; \
326 action: STATE_SET "disabled" 0.0; \
327 target: "cit_"#_pos".text"; \
328 } \
329 program { \
330 source: "cit_"#_pos".clicked"; \
331 signal: "mouse,down,1"; \
332 source: "cit_"#_pos".event"; \
333 action: STATE_SET "highlighted" 0.0; \
334 target: "cit_"#_pos".selected2"; \
335 } \
336 program { \
337 source: "cit_"#_pos".clicked"; \
338 signal: "mouse,up,1"; \
339 source: "cit_"#_pos".event"; \
340 action: STATE_SET "default" 0.0; \
341 target: "cit_"#_pos".selected2"; \
342 } \
343 program { \
344 source: "cit_"#_pos".clicked"; \
345 signal: "mouse,clicked,1"; \
346 source: "cit_"#_pos".event"; \
347 action: SIGNAL_EMIT "elm,action,selected" #_pos; \
348 } \
349 program { \
350 name: "cit_"#_pos".clear"; \
351 signal: "cit_"#_pos",clear"; \
352 source: "elm"; \
353 action: STATE_SET "default" 0.0; \
354 target: "cit_"#_pos".check"; \
355 after: "cit_"#_pos".weekends_clear"; \
356 after: "cit_"#_pos".holiday_clear"; \
357 } \
358 program { \
359 name: "cit_"#_pos".weekends_clear"; \
360 script { \
361 new st[31]; \
362 new Float:vl; \
363 get_state(PART:"cit_"#_pos".text", st, 30, vl); \
364 if (!strcmp(st, "weekend/day1") || !strcmp(st, "weekend/day2")) \
365 set_state(PART:"cit_"#_pos".text", "default", 0.0); \
366 } \
367 } \
368 program { \
369 name: "cit_"#_pos".holiday_clear"; \
370 script { \
371 new st[31]; \
372 new Float:vl; \
373 get_state(PART:"cit_"#_pos".text", st, 30, vl); \
374 if (!strcmp(st, "holiday")) \
375 set_state(PART:"cit_"#_pos".text", "default", 0.0); \
376 } \
377 } \
378 program { \
379 name: "cit_"#_pos".checked"; \
380 signal: "cit_"#_pos",checked"; \
381 source: "elm"; \
382 action: STATE_SET "visible" 0.0; \
383 target: "cit_"#_pos".check"; \
384 } \
385 program { \
386 name: "cit_"#_pos".holiday"; \
387 signal: "cit_"#_pos",holiday"; \
388 source: "elm"; \
389 script { \
390 new st[31]; \
391 new Float:vl; \
392 get_state(PART:"cit_"#_pos".text", st, 30, vl); \
393 if (strcmp(st, "today")) \
394 set_state(PART:"cit_"#_pos".text", "holiday", 0.0); \
395 } \
396 } \
397 program { \
398 name: "cit_"#_pos".weekend/day1"; \
399 signal: "cit_"#_pos",weekend/day1"; \
400 source: "elm"; \
401 script { \
402 new st[31]; \
403 new Float:vl; \
404 get_state(PART:"cit_"#_pos".text", st, 30, vl); \
405 if ((strcmp(st, "today")) && (strcmp(st, "holiday")) )\
406 set_state(PART:"cit_"#_pos".text", "weekend/day1", 0.0); \
407 } \
408 } \
409 program { \
410 name: "cit_"#_pos".weekend/day2"; \
411 signal: "cit_"#_pos",weekend/day2"; \
412 source: "elm"; \
413 script { \
414 new st[31]; \
415 new Float:vl; \
416 get_state(PART:"cit_"#_pos".text", st, 30, vl); \
417 if ((strcmp(st, "today")) && (strcmp(st, "holiday")) )\
418 set_state(PART:"cit_"#_pos".text", "weekend/day2", 0.0); \
419 } \
420 } \
421 }
422
1group { "efl/calendar"; 423group { "efl/calendar";
2 inherit: "elm/calendar/base/default"; 424 images.image: "sym_left_light_normal.png" COMP;
425 images.image: "sym_right_light_normal.png" COMP;
426 images.image: "sym_left_glow_normal.png" COMP;
427 images.image: "sym_right_glow_normal.png" COMP;
428 images.image: "icon_border_remember.png" COMP;
429 images.image: "outline_glow.png" COMP;
430 images.image: "box_glow.png" COMP;
431 images.image: "diagonal_stripes.png" COMP;
432 data.item: "focus_highlight" "on";
433 script {
434 public rtl;
435 public win_focus_enabled;
436 public item_focus_enabled;
437 public last_focused_item;
438 }
439 styles {
440 CIT_STYLES
441 }
442 parts {
443 part { name: "bg"; type: SPACER;
444 description { state: "default" 0.0;
445 rel1.offset: 1 1;
446 rel2.offset: -2 -2;
447 }
448 }
449 part { name: "background"; type: SWALLOW;
450 description { state: "default" 0.0;
451 rel1.to: "bg";
452 rel2.to: "bg";
453 }
454 }
455 part { name: "spinner-base1"; type: SPACER;
456 description { state: "default" 0.0;
457 min: 24 16;
458 max: 999999 16;
459 rel1.to: "bg";
460 rel2.to: "bg";
461 rel2.relative: 1.0 (1/8);
462 align: 0.5 0.0;
463 }
464 }
465 part { name: "table-base"; type: SPACER;
466 description { state: "default" 0.0;
467 min: 70 60;
468 rel1.to_x: "bg";
469 rel1.to_y: "spinner-base1";
470 rel1.offset: 3 0;
471 rel1.relative: 0.0 1.0;
472 rel2.to: "bg";
473 rel2.offset: -4 -4;
474 }
475 }
476 part { name: "header"; type: SPACER;
477 description { state: "default" 0.0;
478 rel1.to: "table-base";
479 rel2.to: "table-base";
480 rel2.relative: 1.0 (1/7);
481 align: 0.5 0.0;
482 min: 0 16;
483 }
484 }
485 part { name: "header_separator"; mouse_events: 0;
486 description { state: "default" 0.0;
487 fixed: 1 1;
488 rel1.to: "header";
489 rel1.relative: 0.0 1.0;
490 rel1.offset: 0 -2;
491 rel2.to: "header";
492 image.normal: "separator_horiz.png";
493 fill.smooth: 0;
494 }
495 }
496 part { name: "base"; type: SPACER;
497 description { state: "default" 0.0;
498 rel1.to_x: "table-base";
499 rel1.to_y: "header";
500 rel1.relative: 0.0 1.0;
501 rel1.offset: 3 0;
502 rel2.to: "table-base";
503 rel2.offset: -3 0;
504 }
505 }
506
507 CAL_SPIN(,month_text, spinner-base1)
508 CH(0) CH(1) CH(2) CH(3) CH(4) CH(5) CH(6)
509 CIT(0) CIT(1) CIT(2) CIT(3) CIT(4) CIT(5) CIT(6)
510 CIT(7) CIT(8) CIT(9) CIT(10) CIT(11) CIT(12) CIT(13)
511 CIT(14) CIT(15) CIT(16) CIT(17) CIT(18) CIT(19) CIT(20)
512 CIT(21) CIT(22) CIT(23) CIT(24) CIT(25) CIT(26) CIT(27)
513 CIT(28) CIT(29) CIT(30) CIT(31) CIT(32) CIT(33) CIT(34)
514 CIT(35) CIT(36) CIT(37) CIT(38) CIT(39) CIT(40) CIT(41)
515
516 }
517 programs {
518 program {
519 signal: "elm,action,focus_highlight,show";
520 source: "elm";
521 script {
522 set_int(win_focus_enabled, 1);
523 if (get_int(item_focus_enabled) == 1) {
524 new value[32];
525 snprintf(value, 32, "cit_%d,focused", get_int(last_focused_item));
526 emit(value, "elm");
527 }
528 }
529 }
530 program {
531 signal: "elm,action,focus_highlight,hide";
532 source: "elm";
533 script {
534 set_int(win_focus_enabled, 0);
535 }
536 }
537 }
538}
539
540#undef CAL_SPIN
541#undef CIT
542#undef CH
543
544
545group { "efl/calendar/inc_button";
546 inherit: "elm/button/base/calendar/increase/default";
547}
548
549group { "efl/calendar/dec_button";
550 inherit: "elm/button/base/calendar/decrease/default";
3} 551}
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