summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/default/base.src.in18
-rw-r--r--config/mobile/base.src.in18
-rw-r--r--config/standard/base.src.in18
-rw-r--r--data/elementary/themes/edc/elm/calendar.edc62
-rw-r--r--src/lib/elementary/elm_calendar.c266
-rw-r--r--src/lib/elementary/elm_calendar.eo1
-rw-r--r--src/lib/elementary/elm_widget_calendar.h2
7 files changed, 378 insertions, 7 deletions
diff --git a/config/default/base.src.in b/config/default/base.src.in
index dfecc901d8..9128b98d97 100644
--- a/config/default/base.src.in
+++ b/config/default/base.src.in
@@ -727,6 +727,24 @@ group "Elm_Config" struct {
727 value "action" string: "move"; 727 value "action" string: "move";
728 value "params" string: "down"; 728 value "params" string: "down";
729 } 729 }
730 group "Elm_Config_Binding_Key" struct {
731 value "context" int: 0;
732 value "key" string: "Return";
733 value "action" string: "activate";
734 value "params" string: "";
735 }
736 group "Elm_Config_Binding_Key" struct {
737 value "context" int: 0;
738 value "key" string: "KP_Enter";
739 value "action" string: "activate";
740 value "params" string: "";
741 }
742 group "Elm_Config_Binding_Key" struct {
743 value "context" int: 0;
744 value "key" string: "space";
745 value "action" string: "activate";
746 value "params" string: "";
747 }
730 } 748 }
731 } 749 }
732 group "Elm_Config_Bindings_Widget" struct { 750 group "Elm_Config_Bindings_Widget" struct {
diff --git a/config/mobile/base.src.in b/config/mobile/base.src.in
index ebc5070ae6..f1a357b22e 100644
--- a/config/mobile/base.src.in
+++ b/config/mobile/base.src.in
@@ -731,6 +731,24 @@ group "Elm_Config" struct {
731 value "action" string: "move"; 731 value "action" string: "move";
732 value "params" string: "down"; 732 value "params" string: "down";
733 } 733 }
734 group "Elm_Config_Binding_Key" struct {
735 value "context" int: 0;
736 value "key" string: "Return";
737 value "action" string: "activate";
738 value "params" string: "";
739 }
740 group "Elm_Config_Binding_Key" struct {
741 value "context" int: 0;
742 value "key" string: "KP_Enter";
743 value "action" string: "activate";
744 value "params" string: "";
745 }
746 group "Elm_Config_Binding_Key" struct {
747 value "context" int: 0;
748 value "key" string: "space";
749 value "action" string: "activate";
750 value "params" string: "";
751 }
734 } 752 }
735 } 753 }
736 group "Elm_Config_Bindings_Widget" struct { 754 group "Elm_Config_Bindings_Widget" struct {
diff --git a/config/standard/base.src.in b/config/standard/base.src.in
index d5cd732f3f..678e274515 100644
--- a/config/standard/base.src.in
+++ b/config/standard/base.src.in
@@ -728,6 +728,24 @@ group "Elm_Config" struct {
728 value "action" string: "move"; 728 value "action" string: "move";
729 value "params" string: "down"; 729 value "params" string: "down";
730 } 730 }
731 group "Elm_Config_Binding_Key" struct {
732 value "context" int: 0;
733 value "key" string: "Return";
734 value "action" string: "activate";
735 value "params" string: "";
736 }
737 group "Elm_Config_Binding_Key" struct {
738 value "context" int: 0;
739 value "key" string: "KP_Enter";
740 value "action" string: "activate";
741 value "params" string: "";
742 }
743 group "Elm_Config_Binding_Key" struct {
744 value "context" int: 0;
745 value "key" string: "space";
746 value "action" string: "activate";
747 value "params" string: "";
748 }
731 } 749 }
732 } 750 }
733 group "Elm_Config_Bindings_Widget" struct { 751 group "Elm_Config_Bindings_Widget" struct {
diff --git a/data/elementary/themes/edc/elm/calendar.edc b/data/elementary/themes/edc/elm/calendar.edc
index 662bd51def..8dfffc169c 100644
--- a/data/elementary/themes/edc/elm/calendar.edc
+++ b/data/elementary/themes/edc/elm/calendar.edc
@@ -200,6 +200,21 @@
200 visible: 1; \ 200 visible: 1; \
201 } \ 201 } \
202 } \ 202 } \
203 part { name: "cit_"#_pos".glow"; mouse_events: 0; \
204 description { state: "default" 0.0; \
205 rel1.to: "cit_"#_pos".rect"; \
206 rel2.to: "cit_"#_pos".rect"; \
207 image.normal: "box_glow.png"; \
208 image.border: 12 12 12 12; \
209 image.middle: 0; \
210 fill.smooth: 0; \
211 visible: 0; \
212 } \
213 description { state: "focused" 0.0; \
214 inherit: "default" 0.0; \
215 visible: 1; \
216 } \
217 } \
203 part { name: "cit_"#_pos".text"; type: TEXTBLOCK; mouse_events: 0; \ 218 part { name: "cit_"#_pos".text"; type: TEXTBLOCK; mouse_events: 0; \
204 scale: 1; \ 219 scale: 1; \
205 description { state: "default" 0.0; \ 220 description { state: "default" 0.0; \
@@ -280,6 +295,26 @@
280 target: "cit_"#_pos".selected"; \ 295 target: "cit_"#_pos".selected"; \
281 } \ 296 } \
282 program { \ 297 program { \
298 name: "cit_"#_pos".focus_highlighted"; \
299 signal: "cit_"#_pos",focused"; \
300 source: "elm"; \
301 script { \
302 set_int(item_focus_enabled, 1); \
303 set_int(last_focused_item, _pos); \
304 if (get_int(win_focus_enabled) == 1) \
305 set_state(PART:"cit_"#_pos".glow", "focused", 0.0); \
306 } \
307 } \
308 program { \
309 name: "cit_"#_pos".focus_unhighlighed"; \
310 signal: "cit_"#_pos",unfocused"; \
311 source: "elm"; \
312 script { \
313 set_int(item_focus_enabled, 0); \
314 set_state(PART:"cit_"#_pos".glow", "default", 0.0); \
315 } \
316 } \
317 program { \
283 name: "cit_"#_pos".is_today"; \ 318 name: "cit_"#_pos".is_today"; \
284 signal: "cit_"#_pos",today"; \ 319 signal: "cit_"#_pos",today"; \
285 source: "elm"; \ 320 source: "elm"; \
@@ -413,9 +448,14 @@ group { name: "elm/calendar/base/default";
413 images.image: "sym_right_glow_normal.png" COMP; 448 images.image: "sym_right_glow_normal.png" COMP;
414 images.image: "icon_border_remember.png" COMP; 449 images.image: "icon_border_remember.png" COMP;
415 images.image: "outline_glow.png" COMP; 450 images.image: "outline_glow.png" COMP;
451 images.image: "box_glow.png" COMP;
416 images.image: "diagonal_stripes.png" COMP; 452 images.image: "diagonal_stripes.png" COMP;
453 data.item: "focus_highlight" "on";
417 script { 454 script {
418 public rtl; 455 public rtl;
456 public win_focus_enabled;
457 public item_focus_enabled;
458 public last_focused_item;
419 } 459 }
420 styles { 460 styles {
421 CIT_STYLES 461 CIT_STYLES
@@ -493,6 +533,28 @@ group { name: "elm/calendar/base/default";
493 CIT(21) CIT(22) CIT(23) CIT(24) CIT(25) CIT(26) CIT(27) 533 CIT(21) CIT(22) CIT(23) CIT(24) CIT(25) CIT(26) CIT(27)
494 CIT(28) CIT(29) CIT(30) CIT(31) CIT(32) CIT(33) CIT(34) 534 CIT(28) CIT(29) CIT(30) CIT(31) CIT(32) CIT(33) CIT(34)
495 CIT(35) CIT(36) CIT(37) CIT(38) CIT(39) CIT(40) CIT(41) 535 CIT(35) CIT(36) CIT(37) CIT(38) CIT(39) CIT(40) CIT(41)
536
537 }
538 programs {
539 program {
540 signal: "elm,action,focus_highlight,show";
541 source: "elm";
542 script {
543 set_int(win_focus_enabled, 1);
544 if (get_int(item_focus_enabled) == 1) {
545 new value[32];
546 snprintf(value, 32, "cit_%d,focused", get_int(last_focused_item));
547 emit(value, "elm");
548 }
549 }
550 }
551 program {
552 signal: "elm,action,focus_highlight,hide";
553 source: "elm";
554 script {
555 set_int(win_focus_enabled, 0);
556 }
557 }
496 } 558 }
497} 559}
498 560
diff --git a/src/lib/elementary/elm_calendar.c b/src/lib/elementary/elm_calendar.c
index b0fcc580b7..6e57c26346 100644
--- a/src/lib/elementary/elm_calendar.c
+++ b/src/lib/elementary/elm_calendar.c
@@ -125,9 +125,11 @@ _eina_tmpstr_steal(Eina_Tmpstr *s)
125#endif 125#endif
126 126
127static Eina_Bool _key_action_move(Evas_Object *obj, const char *params); 127static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
128static Eina_Bool _key_action_activate(Evas_Object *obj, const char *params);
128 129
129static const Elm_Action key_actions[] = { 130static const Elm_Action key_actions[] = {
130 {"move", _key_action_move}, 131 {"move", _key_action_move},
132 {"activate", _key_action_activate},
131 {NULL, NULL} 133 {NULL, NULL}
132}; 134};
133 135
@@ -218,7 +220,7 @@ _select(Evas_Object *obj,
218 220
219 ELM_CALENDAR_DATA_GET(obj, sd); 221 ELM_CALENDAR_DATA_GET(obj, sd);
220 222
221 sd->selected_it = selected; 223 sd->focused_it = sd->selected_it = selected;
222 snprintf(emission, sizeof(emission), "cit_%i,selected", selected); 224 snprintf(emission, sizeof(emission), "cit_%i,selected", selected);
223 elm_layout_signal_emit(obj, emission, "elm"); 225 elm_layout_signal_emit(obj, emission, "elm");
224} 226}
@@ -1276,6 +1278,47 @@ _get_item_day(Evas_Object *obj,
1276} 1278}
1277 1279
1278static void 1280static void
1281_update_unfocused_it(Evas_Object *obj, int unfocused_it)
1282{
1283 int day;
1284 char emission[32];
1285
1286 ELM_CALENDAR_DATA_GET(obj, sd);
1287
1288 day = _get_item_day(obj, unfocused_it);
1289 if (!day)
1290 return;
1291
1292 sd->focused_it = -1;
1293
1294 snprintf(emission, sizeof(emission), "cit_%i,unfocused", unfocused_it);
1295 elm_layout_signal_emit(obj, emission, "elm");
1296}
1297
1298static Eina_Bool
1299_update_focused_it(Evas_Object *obj, int focused_it)
1300{
1301 int day;
1302 char emission[32];
1303
1304 ELM_CALENDAR_DATA_GET(obj, sd);
1305
1306 day = _get_item_day(obj, focused_it);
1307 if (!day)
1308 return EINA_FALSE;
1309
1310 snprintf(emission, sizeof(emission), "cit_%i,unfocused", sd->focused_it);
1311 elm_layout_signal_emit(obj, emission, "elm");
1312
1313 sd->focused_it = focused_it;
1314
1315 snprintf(emission, sizeof(emission), "cit_%i,focused", sd->focused_it);
1316 elm_layout_signal_emit(obj, emission, "elm");
1317
1318 return EINA_TRUE;
1319}
1320
1321static void
1279_update_sel_it(Evas_Object *obj, 1322_update_sel_it(Evas_Object *obj,
1280 int sel_it) 1323 int sel_it)
1281{ 1324{
@@ -1293,6 +1336,8 @@ _update_sel_it(Evas_Object *obj,
1293 _unselect(obj, sd->selected_it); 1336 _unselect(obj, sd->selected_it);
1294 if (!sd->selected) 1337 if (!sd->selected)
1295 sd->selected = EINA_TRUE; 1338 sd->selected = EINA_TRUE;
1339 if (sd->focused_it)
1340 _update_unfocused_it(obj, sd->focused_it);
1296 1341
1297 sd->selected_time.tm_mday = day; 1342 sd->selected_time.tm_mday = day;
1298 _fix_selected_time(sd); 1343 _fix_selected_time(sd);
@@ -1349,10 +1394,23 @@ _update_cur_date(void *data)
1349} 1394}
1350 1395
1351static Eina_Bool 1396static Eina_Bool
1397_key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
1398{
1399 ELM_CALENDAR_DATA_GET(obj, sd);
1400
1401 _update_sel_it(obj, sd->focused_it);
1402
1403 return EINA_TRUE;
1404}
1405
1406static Eina_Bool
1352_key_action_move(Evas_Object *obj, const char *params) 1407_key_action_move(Evas_Object *obj, const char *params)
1353{ 1408{
1354 ELM_CALENDAR_DATA_GET(obj, sd); 1409 ELM_CALENDAR_DATA_GET(obj, sd);
1355 const char *dir = params; 1410 const char *dir = params;
1411 Eina_Bool ret, double_spinner = EINA_FALSE;
1412
1413 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1356 1414
1357 _elm_widget_focus_auto_show(obj); 1415 _elm_widget_focus_auto_show(obj);
1358 if (!strcmp(dir, "prior")) 1416 if (!strcmp(dir, "prior"))
@@ -1367,33 +1425,212 @@ _key_action_move(Evas_Object *obj, const char *params)
1367 && ((sd->select_mode != ELM_CALENDAR_SELECT_MODE_ONDEMAND) 1425 && ((sd->select_mode != ELM_CALENDAR_SELECT_MODE_ONDEMAND)
1368 || (sd->selected))) 1426 || (sd->selected)))
1369 { 1427 {
1428 if (edje_object_part_exists(wd->resize_obj, ELM_CALENDAR_BUTTON_YEAR_RIGHT))
1429 double_spinner = EINA_TRUE;
1430
1370 if (!strcmp(dir, "left")) 1431 if (!strcmp(dir, "left"))
1371 { 1432 {
1372 if ((sd->select_mode != ELM_CALENDAR_SELECT_MODE_ONDEMAND) 1433 if ((sd->select_mode != ELM_CALENDAR_SELECT_MODE_ONDEMAND)
1373 || ((sd->shown_time.tm_year == sd->selected_time.tm_year) 1434 || ((sd->shown_time.tm_year == sd->selected_time.tm_year)
1374 && (sd->shown_time.tm_mon == sd->selected_time.tm_mon))) 1435 && (sd->shown_time.tm_mon == sd->selected_time.tm_mon)))
1375 _update_sel_it(obj, sd->selected_it - 1); 1436 {
1437 //Double spinner case.
1438 if (double_spinner)
1439 {
1440 if (elm_object_focus_get(sd->inc_btn_year))
1441 {
1442 elm_object_focus_set(sd->dec_btn_year, EINA_TRUE);
1443 return EINA_TRUE;
1444 }
1445 else if (elm_object_focus_get(sd->dec_btn_year))
1446 {
1447 elm_object_focus_set(sd->inc_btn_month, EINA_TRUE);
1448 return EINA_TRUE;
1449 }
1450 }
1451
1452 //Give focus to dec_btn_month when left key down on the inc_btn_month.
1453 //Leave focus, if key down on dec_btn_month.
1454 if (elm_object_focus_get(sd->inc_btn_month))
1455 {
1456 elm_object_focus_set(sd->dec_btn_month, EINA_TRUE);
1457 return EINA_TRUE;
1458 }
1459 else if (elm_object_focus_get(sd->dec_btn_month)) return EINA_FALSE;
1460
1461 //If key move from the left edge of the calendar,
1462 //Leave the focus policy on window.
1463 if (sd->focused_it % ELM_DAY_LAST == 0)
1464 return EINA_FALSE;
1465
1466 //Focus on the day before the day.
1467 ret = _update_focused_it(obj, sd->focused_it - 1);
1468 if (!ret) return EINA_FALSE;
1469 }
1376 } 1470 }
1377 else if (!strcmp(dir, "right")) 1471 else if (!strcmp(dir, "right"))
1378 { 1472 {
1379 if ((sd->select_mode != ELM_CALENDAR_SELECT_MODE_ONDEMAND) 1473 if ((sd->select_mode != ELM_CALENDAR_SELECT_MODE_ONDEMAND)
1380 || ((sd->shown_time.tm_year == sd->selected_time.tm_year) 1474 || ((sd->shown_time.tm_year == sd->selected_time.tm_year)
1381 && (sd->shown_time.tm_mon == sd->selected_time.tm_mon))) 1475 && (sd->shown_time.tm_mon == sd->selected_time.tm_mon)))
1382 _update_sel_it(obj, sd->selected_it + 1); 1476 {
1477 //Double spinner case.
1478 if (double_spinner)
1479 {
1480 if (elm_object_focus_get(sd->inc_btn_year)) return EINA_FALSE;
1481 else if (elm_object_focus_get(sd->dec_btn_year))
1482 {
1483 elm_object_focus_set(sd->inc_btn_year, EINA_TRUE);
1484 return EINA_TRUE;
1485 }
1486 else if (elm_object_focus_get(sd->inc_btn_month))
1487 {
1488 elm_object_focus_set(sd->dec_btn_year, EINA_TRUE);
1489 return EINA_TRUE;
1490 }
1491 }
1492
1493 //Give focus to inc_btn_month when right key down on the dec_btn_month.
1494 if (elm_object_focus_get(sd->dec_btn_month))
1495 {
1496 elm_object_focus_set(sd->inc_btn_month, EINA_TRUE);
1497 return EINA_TRUE;
1498 }
1499 else if (elm_object_focus_get(sd->inc_btn_month)) return EINA_FALSE;
1500
1501 //If key move from the right edge of the calendar,
1502 //Leave the focus policy on window.
1503 if (sd->focused_it % ELM_DAY_LAST == ELM_DAY_LAST - 1)
1504 return EINA_FALSE;
1505
1506 //Focus on the day after the day.
1507 ret = _update_focused_it(obj, sd->focused_it + 1);
1508 if (!ret) return EINA_FALSE;
1509 }
1383 } 1510 }
1384 else if (!strcmp(dir, "up")) 1511 else if (!strcmp(dir, "up"))
1385 { 1512 {
1386 if ((sd->select_mode != ELM_CALENDAR_SELECT_MODE_ONDEMAND) 1513 if ((sd->select_mode != ELM_CALENDAR_SELECT_MODE_ONDEMAND)
1387 || ((sd->shown_time.tm_year == sd->selected_time.tm_year) 1514 || ((sd->shown_time.tm_year == sd->selected_time.tm_year)
1388 && (sd->shown_time.tm_mon == sd->selected_time.tm_mon))) 1515 && (sd->shown_time.tm_mon == sd->selected_time.tm_mon)))
1389 _update_sel_it(obj, sd->selected_it - ELM_DAY_LAST); 1516 {
1517 //double spinner case.
1518 if (double_spinner)
1519 {
1520 if (elm_object_focus_get(sd->inc_btn_year))
1521 {
1522 elm_object_focus_set(sd->inc_btn_year, EINA_FALSE);
1523 return EINA_FALSE;
1524 }
1525 else if (elm_object_focus_get(sd->dec_btn_year))
1526 {
1527 elm_object_focus_set(sd->dec_btn_year, EINA_FALSE);
1528 return EINA_FALSE;
1529 }
1530 }
1531
1532 //If the dec_btn_month, or inc_btn_month has focus.
1533 //Focus unset and leave the focus policy on window.
1534 if (elm_object_focus_get(sd->dec_btn_month))
1535 {
1536 elm_object_focus_set(sd->dec_btn_month, EINA_FALSE);
1537 return EINA_FALSE;
1538 }
1539 else if (elm_object_focus_get(sd->inc_btn_month))
1540 {
1541 elm_object_focus_set(sd->inc_btn_month, EINA_FALSE);
1542 return EINA_FALSE;
1543 }
1544
1545 //If the focus item is the first week of month.
1546 if ((sd->focused_it >= 0) && (sd->focused_it < ELM_DAY_LAST))
1547 {
1548 //Give focus to inc_btn_month(right side located button)
1549 //If the focused item is smaller than 4.
1550 //Otherwise, give focus to dec_btn_month.
1551 if (sd->focused_it > (ELM_DAY_LAST / 2))
1552 //Double spinner case.
1553 if (edje_object_part_exists(wd->resize_obj, ELM_CALENDAR_BUTTON_YEAR_RIGHT))
1554 elm_object_focus_set(sd->inc_btn_year, EINA_TRUE);
1555 else
1556 elm_object_focus_set(sd->inc_btn_month, EINA_TRUE);
1557 else
1558 elm_object_focus_set(sd->dec_btn_month, EINA_TRUE);
1559
1560 _update_unfocused_it(obj, sd->focused_it);
1561 return EINA_TRUE;
1562 }
1563
1564 //Focus on the last week day.
1565 ret = _update_focused_it(obj, sd->focused_it - ELM_DAY_LAST);
1566 if (!ret)
1567 {
1568 //If focused day is not available(not belongs to current month)
1569 //Take a focus from item and give the focus to suitable button.
1570 if (sd->focused_it >= ELM_DAY_LAST && sd->focused_it < (ELM_DAY_LAST * 2))
1571 {
1572 if (sd->focused_it > (ELM_DAY_LAST + (ELM_DAY_LAST / 2)))
1573 //Double spinner case.
1574 if (edje_object_part_exists(wd->resize_obj, ELM_CALENDAR_BUTTON_YEAR_RIGHT))
1575 elm_object_focus_set(sd->inc_btn_year, EINA_TRUE);
1576 else
1577 elm_object_focus_set(sd->inc_btn_month, EINA_TRUE);
1578 else
1579 elm_object_focus_set(sd->dec_btn_month, EINA_TRUE);
1580
1581 _update_unfocused_it(obj, sd->focused_it);
1582 return EINA_TRUE;
1583 }
1584 }
1585 }
1390 } 1586 }
1391 else if (!strcmp(dir, "down")) 1587 else if (!strcmp(dir, "down"))
1392 { 1588 {
1393 if ((sd->select_mode != ELM_CALENDAR_SELECT_MODE_ONDEMAND) 1589 if ((sd->select_mode != ELM_CALENDAR_SELECT_MODE_ONDEMAND)
1394 || ((sd->shown_time.tm_year == sd->selected_time.tm_year) 1590 || ((sd->shown_time.tm_year == sd->selected_time.tm_year)
1395 && (sd->shown_time.tm_mon == sd->selected_time.tm_mon))) 1591 && (sd->shown_time.tm_mon == sd->selected_time.tm_mon)))
1396 _update_sel_it(obj, sd->selected_it + ELM_DAY_LAST); 1592 {
1593 //double spinner case.
1594 if (double_spinner)
1595 {
1596 if (elm_object_focus_get(sd->inc_btn_year))
1597 {
1598 elm_object_focus_set(sd->inc_btn_year, EINA_FALSE);
1599 evas_object_focus_set(obj, EINA_TRUE);
1600 _update_focused_it(obj, (ELM_DAY_LAST - 1));
1601 return EINA_TRUE;
1602 }
1603 else if (elm_object_focus_get(sd->dec_btn_year))
1604 {
1605 elm_object_focus_set(sd->dec_btn_year, EINA_FALSE);
1606 evas_object_focus_set(obj, EINA_TRUE);
1607 _update_focused_it(obj, sd->first_day_it);
1608 return EINA_TRUE;
1609 }
1610 }
1611
1612 //If the XXX_btn_month has focus.
1613 //Set as false to button focus and give to focus to first item of the calendar.
1614 //Otherwise, Give the focus to last day of first week of calendar.
1615 if (elm_object_focus_get(sd->dec_btn_month))
1616 {
1617 elm_object_focus_set(sd->dec_btn_month, EINA_FALSE);
1618 evas_object_focus_set(obj, EINA_TRUE);
1619 _update_focused_it(obj, sd->first_day_it);
1620 return EINA_TRUE;
1621 }
1622 else if(elm_object_focus_get(sd->inc_btn_month))
1623 {
1624 elm_object_focus_set(sd->inc_btn_month, EINA_FALSE);
1625 evas_object_focus_set(obj, EINA_TRUE);
1626 _update_focused_it(obj, (ELM_DAY_LAST - 1));
1627 return EINA_TRUE;
1628 }
1629
1630 //Focus on the next week day.
1631 ret = _update_focused_it(obj, sd->focused_it + ELM_DAY_LAST);
1632 if (!ret) return EINA_FALSE;
1633 }
1397 } 1634 }
1398 else return EINA_FALSE; 1635 else return EINA_FALSE;
1399 } 1636 }
@@ -1403,6 +1640,22 @@ _key_action_move(Evas_Object *obj, const char *params)
1403} 1640}
1404 1641
1405EOLIAN static Eina_Bool 1642EOLIAN static Eina_Bool
1643_elm_calendar_elm_widget_on_focus(Eo *obj, Elm_Calendar_Data *sd, Elm_Object_Item *item EINA_UNUSED)
1644{
1645 Eina_Bool int_ret = EINA_FALSE;
1646
1647 int_ret = elm_obj_widget_on_focus(efl_super(obj, MY_CLASS), NULL);
1648 if (!int_ret) return EINA_FALSE;
1649
1650 if (elm_widget_focus_get(obj))
1651 sd->focused_it = sd->selected_it;
1652 else
1653 _update_unfocused_it(obj, sd->focused_it);
1654
1655 return EINA_TRUE;
1656}
1657
1658EOLIAN static Eina_Bool
1406_elm_calendar_elm_widget_event(Eo *obj, Elm_Calendar_Data *sd EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info) 1659_elm_calendar_elm_widget_event(Eo *obj, Elm_Calendar_Data *sd EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
1407{ 1660{
1408 (void) src; 1661 (void) src;
@@ -1545,7 +1798,7 @@ static Eina_Bool _elm_calendar_smart_focus_next_enable = EINA_FALSE;
1545EOLIAN static Eina_Bool 1798EOLIAN static Eina_Bool
1546_elm_calendar_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Calendar_Data *_pd EINA_UNUSED) 1799_elm_calendar_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Calendar_Data *_pd EINA_UNUSED)
1547{ 1800{
1548 return EINA_TRUE; 1801 return EINA_FALSE;
1549} 1802}
1550 1803
1551EOLIAN static Eina_Bool 1804EOLIAN static Eina_Bool
@@ -2080,6 +2333,7 @@ _elm_calendar_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNU
2080 { "move,right", "move", "right", _key_action_move}, 2333 { "move,right", "move", "right", _key_action_move},
2081 { "move,up", "move", "up", _key_action_move}, 2334 { "move,up", "move", "up", _key_action_move},
2082 { "move,down", "move", "down", _key_action_move}, 2335 { "move,down", "move", "down", _key_action_move},
2336 { "activate", "activate", NULL, _key_action_activate},
2083 { NULL, NULL, NULL, NULL } 2337 { NULL, NULL, NULL, NULL }
2084 }; 2338 };
2085 return &atspi_actions[0]; 2339 return &atspi_actions[0];
diff --git a/src/lib/elementary/elm_calendar.eo b/src/lib/elementary/elm_calendar.eo
index b312f486be..9890b2f1c9 100644
--- a/src/lib/elementary/elm_calendar.eo
+++ b/src/lib/elementary/elm_calendar.eo
@@ -419,6 +419,7 @@ class Elm.Calendar (Elm.Layout, Elm.Interface.Atspi_Widget_Action)
419 Elm.Widget.focus_direction_manager_is; 419 Elm.Widget.focus_direction_manager_is;
420 Elm.Widget.access; 420 Elm.Widget.access;
421 Elm.Widget.focus_next; 421 Elm.Widget.focus_next;
422 Elm.Widget.on_focus;
422 Elm.Widget.event; 423 Elm.Widget.event;
423 Elm.Layout.sizing_eval; 424 Elm.Layout.sizing_eval;
424 Elm.Interface.Atspi_Widget_Action.elm_actions.get; 425 Elm.Interface.Atspi_Widget_Action.elm_actions.get;
diff --git a/src/lib/elementary/elm_widget_calendar.h b/src/lib/elementary/elm_widget_calendar.h
index 18d3cf7546..b8f7bdf78f 100644
--- a/src/lib/elementary/elm_widget_calendar.h
+++ b/src/lib/elementary/elm_widget_calendar.h
@@ -38,7 +38,7 @@ struct _Elm_Calendar_Data
38 Eina_List *marks; 38 Eina_List *marks;
39 double interval, first_interval; 39 double interval, first_interval;
40 int spin_speed; 40 int spin_speed;
41 int today_it, selected_it, first_day_it; 41 int today_it, selected_it, first_day_it, focused_it;
42 Ecore_Timer *spin_month, *spin_year, *update_timer; 42 Ecore_Timer *spin_month, *spin_year, *update_timer;
43 Elm_Calendar_Format_Cb format_func; 43 Elm_Calendar_Format_Cb format_func;
44 const char *weekdays[ELM_DAY_LAST]; 44 const char *weekdays[ELM_DAY_LAST];