summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/default/base.src2
-rw-r--r--config/mobile/base.src2
-rw-r--r--config/standard/base.src2
-rw-r--r--src/bin/config.c84
-rw-r--r--src/bin/test_gengrid.c23
-rw-r--r--src/bin/test_genlist.c86
-rw-r--r--src/bin/test_list.c21
-rw-r--r--src/bin/test_toolbar.c21
-rw-r--r--src/lib/elm_config.c24
-rw-r--r--src/lib/elm_config.h38
-rw-r--r--src/lib/elm_gengrid.c16
-rw-r--r--src/lib/elm_genlist.c18
-rw-r--r--src/lib/elm_list.c15
-rw-r--r--src/lib/elm_priv.h2
-rw-r--r--src/lib/elm_toolbar.c18
-rw-r--r--src/lib/elm_widget.c16
16 files changed, 265 insertions, 123 deletions
diff --git a/config/default/base.src b/config/default/base.src
index 3f482581d..1bf94c311 100644
--- a/config/default/base.src
+++ b/config/default/base.src
@@ -26,7 +26,7 @@ group "Elm_Config" struct {
26 value "scroll_smooth_history_weight" double: 0.1; 26 value "scroll_smooth_history_weight" double: 0.1;
27 value "scroll_smooth_future_time" double: 0.0; 27 value "scroll_smooth_future_time" double: 0.0;
28 value "scroll_smooth_time_window" double: 0.01; 28 value "scroll_smooth_time_window" double: 0.01;
29 value "focus_auto_scroll_bring_in_enable" uchar: 0; 29 value "focus_autoscroll_mode" uchar: 0;
30 value "scale" double: 1.0; 30 value "scale" double: 1.0;
31 value "bgpixmap" int: 0; 31 value "bgpixmap" int: 0;
32 value "compositing" int: 1; 32 value "compositing" int: 1;
diff --git a/config/mobile/base.src b/config/mobile/base.src
index 6f2d976e7..590ffbf52 100644
--- a/config/mobile/base.src
+++ b/config/mobile/base.src
@@ -26,7 +26,7 @@ group "Elm_Config" struct {
26 value "scroll_smooth_history_weight" double: 0.1; 26 value "scroll_smooth_history_weight" double: 0.1;
27 value "scroll_smooth_future_time" double: 0.0; 27 value "scroll_smooth_future_time" double: 0.0;
28 value "scroll_smooth_time_window" double: 0.01; 28 value "scroll_smooth_time_window" double: 0.01;
29 value "focus_auto_scroll_bring_in_enable" uchar: 0; 29 value "focus_autoscroll_mode" uchar: 0;
30 value "scale" double: 1.0; 30 value "scale" double: 1.0;
31 value "bgpixmap" int: 0; 31 value "bgpixmap" int: 0;
32 value "compositing" int: 1; 32 value "compositing" int: 1;
diff --git a/config/standard/base.src b/config/standard/base.src
index 7472f1f6a..6d2da5bda 100644
--- a/config/standard/base.src
+++ b/config/standard/base.src
@@ -26,7 +26,7 @@ group "Elm_Config" struct {
26 value "scroll_smooth_history_weight" double: 0.1; 26 value "scroll_smooth_history_weight" double: 0.1;
27 value "scroll_smooth_future_time" double: 0.0; 27 value "scroll_smooth_future_time" double: 0.0;
28 value "scroll_smooth_time_window" double: 0.01; 28 value "scroll_smooth_time_window" double: 0.01;
29 value "focus_auto_scroll_bring_in_enable" uchar: 0; 29 value "focus_autoscroll_mode" uchar: 0;
30 value "scale" double: 1.0; 30 value "scale" double: 1.0;
31 value "bgpixmap" int: 0; 31 value "bgpixmap" int: 0;
32 value "compositing" int: 1; 32 value "compositing" int: 1;
diff --git a/src/bin/config.c b/src/bin/config.c
index ac7d3ac25..755cfba2e 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -1591,34 +1591,30 @@ _config_focus_highlight_clip_cb(void *data EINA_UNUSED, Evas_Object *obj,
1591} 1591}
1592 1592
1593static void 1593static void
1594_config_focus_auto_scroll_bring_in_cb(void *data EINA_UNUSED, Evas_Object *obj, 1594_config_focus_item_select_on_focus_cb(void *data EINA_UNUSED, Evas_Object *obj,
1595 void *event_info EINA_UNUSED) 1595 void *event_info EINA_UNUSED)
1596{ 1596{
1597 Eina_Bool cf = elm_config_focus_auto_scroll_bring_in_enabled_get(); 1597 Eina_Bool cf = elm_config_item_select_on_focus_disabled_get();
1598 Eina_Bool val = elm_check_state_get(obj); 1598 Eina_Bool val = elm_check_state_get(obj);
1599 1599
1600 if (cf == val) return; 1600 if (cf == val) return;
1601 elm_config_focus_auto_scroll_bring_in_enabled_set(val); 1601 elm_config_item_select_on_focus_disabled_set(val);
1602 elm_config_all_flush(); 1602 elm_config_all_flush();
1603} 1603}
1604 1604
1605static void 1605static void
1606_config_focus_item_select_on_focus_cb(void *data EINA_UNUSED, Evas_Object *obj, 1606_status_config_focus_autoscroll_changed_cb(void *data EINA_UNUSED,
1607 void *event_info EINA_UNUSED) 1607 Evas_Object *obj,
1608 void *event_info EINA_UNUSED)
1608{ 1609{
1609 Eina_Bool cf = elm_config_item_select_on_focus_disabled_get(); 1610 elm_config_focus_autoscroll_mode_set(elm_radio_value_get(obj));
1610 Eina_Bool val = elm_check_state_get(obj);
1611
1612 if (cf == val) return;
1613 elm_config_item_select_on_focus_disabled_set(val);
1614 elm_config_all_flush();
1615} 1611}
1616 1612
1617static void 1613static void
1618_status_config_focus(Evas_Object *win, 1614_status_config_focus(Evas_Object *win,
1619 Evas_Object *naviframe) 1615 Evas_Object *naviframe)
1620{ 1616{
1621 Evas_Object *bx, *ck; 1617 Evas_Object *bx, *ck, *fr;
1622 1618
1623 bx = elm_box_add(win); 1619 bx = elm_box_add(win);
1624 1620
@@ -1642,19 +1638,69 @@ _status_config_focus(Evas_Object *win,
1642 _config_focus_highlight_clip_cb, NULL); 1638 _config_focus_highlight_clip_cb, NULL);
1643 elm_check_state_set(ck, elm_config_focus_highlight_clip_disabled_get()); 1639 elm_check_state_set(ck, elm_config_focus_highlight_clip_disabled_get());
1644 1640
1645 CHECK_ADD("Enable Auto Scroll Bring-in",
1646 "Set whether enable/disable auto scroll bring-in feature<br/>"
1647 "This is disabled by default so auto scrolling works by show not"
1648 "by bring-in.",
1649 _config_focus_auto_scroll_bring_in_cb, NULL);
1650 elm_check_state_set(ck, elm_config_focus_auto_scroll_bring_in_enabled_get());
1651
1652 CHECK_ADD("Disable Item Select on Focus", 1641 CHECK_ADD("Disable Item Select on Focus",
1653 "Set whether item would be selected on item focus.<br/>" 1642 "Set whether item would be selected on item focus.<br/>"
1654 "This is enabled by default.", 1643 "This is enabled by default.",
1655 _config_focus_item_select_on_focus_cb, NULL); 1644 _config_focus_item_select_on_focus_cb, NULL);
1656 elm_check_state_set(ck, elm_config_item_select_on_focus_disabled_get()); 1645 elm_check_state_set(ck, elm_config_item_select_on_focus_disabled_get());
1657 1646
1647 fr = elm_frame_add(bx);
1648 elm_object_text_set(fr, "Focus Autoscroll Mode");
1649 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
1650 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, 0.5);
1651 elm_box_pack_end(bx, fr);
1652 evas_object_show(fr);
1653 {
1654 Evas_Object *bx2, *rdg, *rd;
1655 bx2 = elm_box_add(fr);
1656 elm_object_content_set(fr, bx2);
1657 evas_object_show(bx2);
1658
1659 rdg = rd = elm_radio_add(bx2);
1660 elm_radio_state_value_set(rd, ELM_FOCUS_AUTOSCROLL_MODE_SHOW);
1661 elm_object_text_set(rd, "ELM_FOCUS_AUTOSCROLL_MODE_SHOW");
1662 elm_object_tooltip_text_set(rd, "Directly show the focused region<br/>"
1663 "or item automatically inside a scroller.");
1664 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
1665 evas_object_size_hint_align_set(rd, 0.0, EVAS_HINT_FILL);
1666 elm_box_pack_end(bx2, rd);
1667 evas_object_show(rd);
1668 evas_object_smart_callback_add(rd, "changed",
1669 _status_config_focus_autoscroll_changed_cb,
1670 NULL);
1671
1672 rd = elm_radio_add(bx2);
1673 elm_radio_state_value_set(rd, ELM_FOCUS_AUTOSCROLL_MODE_NONE);
1674 elm_object_text_set(rd, "ELM_FOCUS_AUTOSCROLL_MODE_NONE");
1675 elm_object_tooltip_text_set(rd, "Do not show the focused region or<br/>"
1676 "item automatically inside a scroller.");
1677 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
1678 evas_object_size_hint_align_set(rd, 0.0, EVAS_HINT_FILL);
1679 elm_box_pack_end(bx2, rd);
1680 elm_radio_group_add(rd, rdg);
1681 evas_object_show(rd);
1682 evas_object_smart_callback_add(rd, "changed",
1683 _status_config_focus_autoscroll_changed_cb,
1684 NULL);
1685
1686
1687 rd = elm_radio_add(bx2);
1688 elm_radio_state_value_set(rd, ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN);
1689 elm_object_text_set(rd, "ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN");
1690 elm_object_tooltip_text_set(rd, "Bring in the focused region or item<br/>"
1691 "automatically which might invole the scrolling.");
1692 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
1693 evas_object_size_hint_align_set(rd, 0.0, EVAS_HINT_FILL);
1694 elm_box_pack_end(bx2, rd);
1695 elm_radio_group_add(rd, rdg);
1696 evas_object_show(rd);
1697 evas_object_smart_callback_add(rd, "changed",
1698 _status_config_focus_autoscroll_changed_cb,
1699 NULL);
1700
1701 elm_radio_value_set(rdg, elm_config_focus_autoscroll_mode_get());
1702 }
1703
1658 evas_object_data_set(win, "focus", bx); 1704 evas_object_data_set(win, "focus", bx);
1659 1705
1660 elm_naviframe_item_simple_push(naviframe, bx); 1706 elm_naviframe_item_simple_push(naviframe, bx);
diff --git a/src/bin/test_gengrid.c b/src/bin/test_gengrid.c
index 784bfa965..5d58b5b79 100644
--- a/src/bin/test_gengrid.c
+++ b/src/bin/test_gengrid.c
@@ -5,6 +5,8 @@
5#endif 5#endif
6#include <Elementary.h> 6#include <Elementary.h>
7 7
8Evas_Object * _focus_autoscroll_mode_frame_create(Evas_Object *parent);
9
8static Elm_Gengrid_Item_Class *gic, *ggic; 10static Elm_Gengrid_Item_Class *gic, *ggic;
9 11
10Evas_Object *grid_content_get(void *data, Evas_Object *obj, const char *part); 12Evas_Object *grid_content_get(void *data, Evas_Object *obj, const char *part);
@@ -1391,14 +1393,6 @@ _gg_focus_focus_animate_changed_cb(void *data,
1391} 1393}
1392 1394
1393static void 1395static void
1394_gg_focus_bring_in_changed_cb(void *data EINA_UNUSED,
1395 Evas_Object *obj,
1396 void *event_info EINA_UNUSED)
1397{
1398 elm_config_focus_auto_scroll_bring_in_enabled_set(elm_check_state_get(obj));
1399}
1400
1401static void
1402_grid_reorder_mode(void *data, Evas_Object *obj, 1396_grid_reorder_mode(void *data, Evas_Object *obj,
1403 void *event_info EINA_UNUSED) 1397 void *event_info EINA_UNUSED)
1404{ 1398{
@@ -1532,15 +1526,6 @@ test_gengrid_focus(void *data EINA_UNUSED,
1532 evas_object_show(ck); 1526 evas_object_show(ck);
1533 1527
1534 ck = elm_check_add(bx_opt); 1528 ck = elm_check_add(bx_opt);
1535 elm_object_text_set(ck, "Focus Auto scroll bring in enable");
1536 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
1537 evas_object_smart_callback_add(ck, "changed", _gg_focus_bring_in_changed_cb,
1538 NULL);
1539 elm_check_state_set(ck, elm_config_focus_auto_scroll_bring_in_enabled_get());
1540 elm_box_pack_end(bx_opt, ck);
1541 evas_object_show(ck);
1542
1543 ck = elm_check_add(bx_opt);
1544 elm_object_text_set(ck, "Item Select on Focus disable"); 1529 elm_object_text_set(ck, "Item Select on Focus disable");
1545 elm_check_state_set(ck, elm_config_item_select_on_focus_disabled_get()); 1530 elm_check_state_set(ck, elm_config_item_select_on_focus_disabled_get());
1546 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0); 1531 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
@@ -1550,6 +1535,10 @@ test_gengrid_focus(void *data EINA_UNUSED,
1550 elm_box_pack_end(bx_opt, ck); 1535 elm_box_pack_end(bx_opt, ck);
1551 evas_object_show(ck); 1536 evas_object_show(ck);
1552 1537
1538 // Focus Autoscroll Mode
1539 fr = _focus_autoscroll_mode_frame_create(bx);
1540 elm_box_pack_end(bx, fr);
1541
1553 //Focus movement policy 1542 //Focus movement policy
1554 fr = elm_frame_add(bx); 1543 fr = elm_frame_add(bx);
1555 elm_object_text_set(fr, "Focus Movement Policy"); 1544 elm_object_text_set(fr, "Focus Movement Policy");
diff --git a/src/bin/test_genlist.c b/src/bin/test_genlist.c
index cdaf14c11..ea9a4c6d1 100644
--- a/src/bin/test_genlist.c
+++ b/src/bin/test_genlist.c
@@ -3807,12 +3807,75 @@ _focus_button_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
3807 printf("Button clicked: %s\n", (char *)data); 3807 printf("Button clicked: %s\n", (char *)data);
3808} 3808}
3809 3809
3810static void 3810void
3811_gl_focus_bring_in_changed_cb(void *data EINA_UNUSED, 3811_focus_autoscroll_changed_cb(void *data EINA_UNUSED,
3812 Evas_Object *obj, 3812 Evas_Object *obj,
3813 void *event_info EINA_UNUSED) 3813 void *event_info EINA_UNUSED)
3814{ 3814{
3815 elm_config_focus_auto_scroll_bring_in_enabled_set(elm_check_state_get(obj)); 3815 elm_config_focus_autoscroll_mode_set(elm_radio_value_get(obj));
3816}
3817
3818/* this function is used in another tests such as list, gengrid, and toolbar. */
3819Evas_Object *
3820_focus_autoscroll_mode_frame_create(Evas_Object *parent)
3821{
3822 Evas_Object *fr, *bx, *rdg, *rd;
3823
3824 fr = elm_frame_add(parent);
3825 elm_object_text_set(fr, "Focus Autoscroll Mode");
3826 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
3827 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, 0.5);
3828 evas_object_show(fr);
3829
3830 bx = elm_box_add(fr);
3831 elm_object_content_set(fr, bx);
3832 evas_object_show(bx);
3833
3834 rdg = rd = elm_radio_add(bx);
3835 elm_radio_state_value_set(rd, ELM_FOCUS_AUTOSCROLL_MODE_SHOW);
3836 elm_object_text_set(rd, "ELM_FOCUS_AUTOSCROLL_MODE_SHOW");
3837 elm_object_tooltip_text_set(rd, "Directly show the focused region<br/>"
3838 "or item automatically inside a scroller.");
3839 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
3840 evas_object_size_hint_align_set(rd, 0.0, EVAS_HINT_FILL);
3841 elm_box_pack_end(bx, rd);
3842 evas_object_show(rd);
3843 evas_object_smart_callback_add(rd, "changed",
3844 _focus_autoscroll_changed_cb,
3845 NULL);
3846
3847 rd = elm_radio_add(bx);
3848 elm_radio_state_value_set(rd, ELM_FOCUS_AUTOSCROLL_MODE_NONE);
3849 elm_object_text_set(rd, "ELM_FOCUS_AUTOSCROLL_MODE_NONE");
3850 elm_object_tooltip_text_set(rd, "Do not show the focused region or<br/>"
3851 "item automatically inside a scroller.");
3852 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
3853 evas_object_size_hint_align_set(rd, 0.0, EVAS_HINT_FILL);
3854 elm_box_pack_end(bx, rd);
3855 elm_radio_group_add(rd, rdg);
3856 evas_object_show(rd);
3857 evas_object_smart_callback_add(rd, "changed",
3858 _focus_autoscroll_changed_cb,
3859 NULL);
3860
3861
3862 rd = elm_radio_add(bx);
3863 elm_radio_state_value_set(rd, ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN);
3864 elm_object_text_set(rd, "ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN");
3865 elm_object_tooltip_text_set(rd, "Bring in the focused region or item<br/>"
3866 "automatically which might invole the scrolling.");
3867 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
3868 evas_object_size_hint_align_set(rd, 0.0, EVAS_HINT_FILL);
3869 elm_box_pack_end(bx, rd);
3870 elm_radio_group_add(rd, rdg);
3871 evas_object_show(rd);
3872 evas_object_smart_callback_add(rd, "changed",
3873 _focus_autoscroll_changed_cb,
3874 NULL);
3875
3876 elm_radio_value_set(rdg, elm_config_focus_autoscroll_mode_get());
3877
3878 return fr;
3816} 3879}
3817 3880
3818void 3881void
@@ -3979,15 +4042,6 @@ test_genlist_focus(void *data EINA_UNUSED,
3979 evas_object_show(chk); 4042 evas_object_show(chk);
3980 4043
3981 chk = elm_check_add(bx_opt); 4044 chk = elm_check_add(bx_opt);
3982 elm_object_text_set(chk, "Focus Auto scroll bring in enable");
3983 evas_object_size_hint_weight_set(chk, EVAS_HINT_EXPAND, 0.0);
3984 evas_object_smart_callback_add(chk, "changed", _gl_focus_bring_in_changed_cb,
3985 NULL);
3986 elm_check_state_set(chk, elm_config_focus_auto_scroll_bring_in_enabled_get());
3987 elm_box_pack_end(bx_opt, chk);
3988 evas_object_show(chk);
3989
3990 chk = elm_check_add(bx_opt);
3991 elm_object_text_set(chk, "Item Select on Focus disable"); 4045 elm_object_text_set(chk, "Item Select on Focus disable");
3992 elm_check_state_set(chk, elm_config_item_select_on_focus_disabled_get()); 4046 elm_check_state_set(chk, elm_config_item_select_on_focus_disabled_get());
3993 evas_object_size_hint_weight_set(chk, EVAS_HINT_EXPAND, 0.0); 4047 evas_object_size_hint_weight_set(chk, EVAS_HINT_EXPAND, 0.0);
@@ -3997,6 +4051,10 @@ test_genlist_focus(void *data EINA_UNUSED,
3997 elm_box_pack_end(bx_opt, chk); 4051 elm_box_pack_end(bx_opt, chk);
3998 evas_object_show(chk); 4052 evas_object_show(chk);
3999 4053
4054 // Focus Autoscroll Mode
4055 fr = _focus_autoscroll_mode_frame_create(bx);
4056 elm_box_pack_end(bx, fr);
4057
4000 // Focus Movement Policy 4058 // Focus Movement Policy
4001 fr = elm_frame_add(bx); 4059 fr = elm_frame_add(bx);
4002 elm_object_text_set(fr, "Focus Movement Policy"); 4060 elm_object_text_set(fr, "Focus Movement Policy");
diff --git a/src/bin/test_list.c b/src/bin/test_list.c
index c7807983c..be96c75f7 100644
--- a/src/bin/test_list.c
+++ b/src/bin/test_list.c
@@ -5,6 +5,8 @@
5#endif 5#endif
6#include <Elementary.h> 6#include <Elementary.h>
7 7
8Evas_Object * _focus_autoscroll_mode_frame_create(Evas_Object *parent);
9
8struct _api_data 10struct _api_data
9{ 11{
10 unsigned int state; /* What state we are testing */ 12 unsigned int state; /* What state we are testing */
@@ -1397,14 +1399,6 @@ _focus_button_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
1397} 1399}
1398 1400
1399static void 1401static void
1400_test_list_focus_bring_in_changed(void *data EINA_UNUSED,
1401 Evas_Object *obj,
1402 void *event_info EINA_UNUSED)
1403{
1404 elm_config_focus_auto_scroll_bring_in_enabled_set(elm_check_state_get(obj));
1405}
1406
1407static void
1408_test_list_focus(const char *name, const char *title, Eina_Bool horiz) 1402_test_list_focus(const char *name, const char *title, Eina_Bool horiz)
1409{ 1403{
1410 Evas_Object *win, *li, *btn, *bx, *bx2, *fr, *bx_opt, *chk, *bx_btn; 1404 Evas_Object *win, *li, *btn, *bx, *bx2, *fr, *bx_opt, *chk, *bx_btn;
@@ -1540,14 +1534,9 @@ _test_list_focus(const char *name, const char *title, Eina_Bool horiz)
1540 elm_box_pack_end(bx_opt, chk); 1534 elm_box_pack_end(bx_opt, chk);
1541 evas_object_show(chk); 1535 evas_object_show(chk);
1542 1536
1543 chk = elm_check_add(bx_opt); 1537 // Focus Autoscroll Mode
1544 elm_object_text_set(chk, "Focus Auto scroll bring in enable"); 1538 fr = _focus_autoscroll_mode_frame_create(bx);
1545 evas_object_size_hint_weight_set(chk, EVAS_HINT_EXPAND, 0.0); 1539 elm_box_pack_end(bx, fr);
1546 evas_object_smart_callback_add(chk, "changed", _test_list_focus_bring_in_changed,
1547 NULL);
1548 elm_check_state_set(chk, elm_config_focus_auto_scroll_bring_in_enabled_get());
1549 elm_box_pack_end(bx_opt, chk);
1550 evas_object_show(chk);
1551 1540
1552 // Focus Movement Policy 1541 // Focus Movement Policy
1553 fr = elm_frame_add(bx); 1542 fr = elm_frame_add(bx);
diff --git a/src/bin/test_toolbar.c b/src/bin/test_toolbar.c
index 510899f5c..e1d2dd2dc 100644
--- a/src/bin/test_toolbar.c
+++ b/src/bin/test_toolbar.c
@@ -3,6 +3,8 @@
3#endif 3#endif
4#include <Elementary.h> 4#include <Elementary.h>
5 5
6Evas_Object * _focus_autoscroll_mode_frame_create(Evas_Object *parent);
7
6static void 8static void
7_tb_sel1_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 9_tb_sel1_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
8{ 10{
@@ -1126,14 +1128,6 @@ test_toolbar_focus_focus_move_policy_changed(void *data EINA_UNUSED,
1126 elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_IN); 1128 elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_IN);
1127} 1129}
1128 1130
1129static void
1130_test_toolbar_focus_bring_in_changed(void *data EINA_UNUSED,
1131 Evas_Object *obj,
1132 void *event_info EINA_UNUSED)
1133{
1134 elm_config_focus_auto_scroll_bring_in_enabled_set(elm_check_state_get(obj));
1135}
1136
1137void 1131void
1138test_toolbar_focus(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 1132test_toolbar_focus(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
1139{ 1133{
@@ -1221,14 +1215,9 @@ test_toolbar_focus(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
1221 _test_toolbar_focus_focus_animate_check_changed, 1215 _test_toolbar_focus_focus_animate_check_changed,
1222 win); 1216 win);
1223 1217
1224 chk = elm_check_add(bx_opt); 1218 // Focus Autoscroll Mode
1225 elm_object_text_set(chk, "Focus Auto scroll bring in enable"); 1219 fr = _focus_autoscroll_mode_frame_create(bx);
1226 evas_object_size_hint_weight_set(chk, EVAS_HINT_EXPAND, 0.0); 1220 elm_box_pack_end(bx, fr);
1227 evas_object_smart_callback_add(chk, "changed", _test_toolbar_focus_bring_in_changed,
1228 NULL);
1229 elm_check_state_set(chk, elm_config_focus_auto_scroll_bring_in_enabled_get());
1230 elm_box_pack_end(bx_opt, chk);
1231 evas_object_show(chk);
1232 1221
1233 // Focus movement policy 1222 // Focus movement policy
1234 fr = elm_frame_add(bx); 1223 fr = elm_frame_add(bx);
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index ba01789f3..9d8632b99 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -528,7 +528,7 @@ _desc_init(void)
528 ELM_CONFIG_VAL(D, T, focus_highlight_animate, T_UCHAR); 528 ELM_CONFIG_VAL(D, T, focus_highlight_animate, T_UCHAR);
529 ELM_CONFIG_VAL(D, T, focus_highlight_clip_disable, T_UCHAR); 529 ELM_CONFIG_VAL(D, T, focus_highlight_clip_disable, T_UCHAR);
530 ELM_CONFIG_VAL(D, T, focus_move_policy, T_UCHAR); 530 ELM_CONFIG_VAL(D, T, focus_move_policy, T_UCHAR);
531 ELM_CONFIG_VAL(D, T, focus_auto_scroll_bring_in_enable, T_UCHAR); 531 ELM_CONFIG_VAL(D, T, focus_autoscroll_mode, T_UCHAR);
532 ELM_CONFIG_VAL(D, T, item_select_on_focus_disable, T_UCHAR); 532 ELM_CONFIG_VAL(D, T, item_select_on_focus_disable, T_UCHAR);
533 ELM_CONFIG_VAL(D, T, toolbar_shrink_mode, T_INT); 533 ELM_CONFIG_VAL(D, T, toolbar_shrink_mode, T_INT);
534 ELM_CONFIG_VAL(D, T, fileselector_expand_enable, T_UCHAR); 534 ELM_CONFIG_VAL(D, T, fileselector_expand_enable, T_UCHAR);
@@ -2027,8 +2027,16 @@ _env_get(void)
2027 if (s) _elm_config->scroll_smooth_future_time = _elm_atof(s); 2027 if (s) _elm_config->scroll_smooth_future_time = _elm_atof(s);
2028 s = getenv("ELM_SCROLL_SMOOTH_TIME_WINDOW"); 2028 s = getenv("ELM_SCROLL_SMOOTH_TIME_WINDOW");
2029 if (s) _elm_config->scroll_smooth_time_window = _elm_atof(s); 2029 if (s) _elm_config->scroll_smooth_time_window = _elm_atof(s);
2030 s = getenv("ELM_FOCUS_AUTO_SCROLL_BRING_IN_ENABLE"); 2030 s = getenv("ELM_FOCUS_AUTOSCROLL_MODE");
2031 if (s) _elm_config->focus_auto_scroll_bring_in_enable = !!atoi(s); 2031 if (s)
2032 {
2033 if (!strcmp(s, "ELM_FOCUS_AUTOSCROLL_MODE_NONE"))
2034 _elm_config->focus_autoscroll_mode = ELM_FOCUS_AUTOSCROLL_MODE_NONE;
2035 else if (!strcmp(s, "ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN"))
2036 _elm_config->focus_autoscroll_mode = ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN;
2037 else
2038 _elm_config->focus_autoscroll_mode = ELM_FOCUS_AUTOSCROLL_MODE_SHOW;
2039 }
2032 2040
2033 s = getenv("ELM_THEME"); 2041 s = getenv("ELM_THEME");
2034 if (s) eina_stringshare_replace(&_elm_config->theme, s); 2042 if (s) eina_stringshare_replace(&_elm_config->theme, s);
@@ -2926,16 +2934,16 @@ elm_config_scroll_thumbscroll_acceleration_weight_set(double weight)
2926 _elm_config->thumbscroll_acceleration_weight = weight; 2934 _elm_config->thumbscroll_acceleration_weight = weight;
2927} 2935}
2928 2936
2929EAPI Eina_Bool 2937EAPI Elm_Focus_Autoscroll_Mode
2930elm_config_focus_auto_scroll_bring_in_enabled_get(void) 2938elm_config_focus_autoscroll_mode_get(void)
2931{ 2939{
2932 return _elm_config->focus_auto_scroll_bring_in_enable; 2940 return _elm_config->focus_autoscroll_mode;
2933} 2941}
2934 2942
2935EAPI void 2943EAPI void
2936elm_config_focus_auto_scroll_bring_in_enabled_set(Eina_Bool enabled) 2944elm_config_focus_autoscroll_mode_set(Elm_Focus_Autoscroll_Mode mode)
2937{ 2945{
2938 _elm_config->focus_auto_scroll_bring_in_enable = !!enabled; 2946 _elm_config->focus_autoscroll_mode = mode;
2939} 2947}
2940 2948
2941EAPI void 2949EAPI void
diff --git a/src/lib/elm_config.h b/src/lib/elm_config.h
index c95818653..8340661b7 100644
--- a/src/lib/elm_config.h
+++ b/src/lib/elm_config.h
@@ -551,24 +551,48 @@ EAPI double elm_config_scroll_thumbscroll_acceleration_weight_get(void);
551EAPI void elm_config_scroll_thumbscroll_acceleration_weight_set(double weight); 551EAPI void elm_config_scroll_thumbscroll_acceleration_weight_set(double weight);
552 552
553/** 553/**
554 * Get enable status of focus auto scroll bring in. 554 * Focus Autoscroll Mode
555 * 555 *
556 * @see elm_config_focus_auto_scroll_bring_in_enabled_set() 556 * @since 1.10
557 * @ingroup Focus
558 */
559typedef enum
560{
561 ELM_FOCUS_AUTOSCROLL_MODE_SHOW, /**< directly show the focused region or item automatically */
562 ELM_FOCUS_AUTOSCROLL_MODE_NONE, /**< do not show the focused region or item automatically */
563 ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN /**< bring_in the focused region or item automatically which might invole the scrolling */
564} Elm_Focus_Autoscroll_Mode;
565
566/**
567 * Get focus auto scroll mode.
568 *
569 * When a region or an item is focused and it resides inside any scroller,
570 * elementary will automatically scroll the focused area to the visible
571 * viewport.
572 *
573 * @see elm_config_focus_autoscroll_mode_set()
557 * @ingroup Focus 574 * @ingroup Focus
558 * @since 1.10 575 * @since 1.10
559 */ 576 */
560EAPI Eina_Bool elm_config_focus_auto_scroll_bring_in_enabled_get(void); 577EAPI Elm_Focus_Autoscroll_Mode elm_config_focus_autoscroll_mode_get(void);
561 578
562/** 579/**
563 * Set enable status of focus auto scroll bring in. 580 * Set focus auto scroll mode.
581 *
582 * @param mode focus auto scroll mode. This can be one of the
583 * Elm_Focus_Autoscroll_Mode enum values.
564 * 584 *
565 * @param enabled enable scroll bring in if @c EINA_TRUE, disable otherwise 585 * When a region or an item is focused and it resides inside any scroller,
586 * elementary will automatically scroll the focused area to the visible
587 * viewport.
588 * Focus auto scroll mode is set to @c ELM_FOCUS_AUTOSCROLL_MODE_SHOW by
589 * default historically.
566 * 590 *
567 * @see elm_config_focus_auto_scroll_bring_in_enabled_get() 591 * @see elm_config_focus_autoscroll_mode_get()
568 * @ingroup Focus 592 * @ingroup Focus
569 * @since 1.10 593 * @since 1.10
570 */ 594 */
571EAPI void elm_config_focus_auto_scroll_bring_in_enabled_set(Eina_Bool enabled); 595EAPI void elm_config_focus_autoscroll_mode_set(Elm_Focus_Autoscroll_Mode mode);
572 596
573/** 597/**
574 * @} 598 * @}
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index b91ddc5f2..3eebaf430 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -1487,12 +1487,20 @@ _elm_gengrid_item_focused(Elm_Gen_Item *it)
1487 (elm_widget_item_disabled_get(it))) 1487 (elm_widget_item_disabled_get(it)))
1488 return; 1488 return;
1489 1489
1490 if (!_elm_config->focus_auto_scroll_bring_in_enable) 1490 switch (_elm_config->focus_autoscroll_mode)
1491 elm_gengrid_item_show 1491 {
1492 case ELM_FOCUS_AUTOSCROLL_MODE_SHOW:
1493 elm_gengrid_item_show
1492 ((Elm_Object_Item *)it, ELM_GENGRID_ITEM_SCROLLTO_IN); 1494 ((Elm_Object_Item *)it, ELM_GENGRID_ITEM_SCROLLTO_IN);
1493 else 1495 break;
1494 elm_gengrid_item_bring_in 1496 case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN:
1497 elm_gengrid_item_bring_in
1495 ((Elm_Object_Item *)it, ELM_GENGRID_ITEM_SCROLLTO_IN); 1498 ((Elm_Object_Item *)it, ELM_GENGRID_ITEM_SCROLLTO_IN);
1499 break;
1500 default:
1501 break;
1502 }
1503
1496 sd->focused_item = (Elm_Object_Item *)it; 1504 sd->focused_item = (Elm_Object_Item *)it;
1497 1505
1498 if (elm_widget_focus_highlight_enabled_get(obj)) 1506 if (elm_widget_focus_highlight_enabled_get(obj))
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index c220d340d..c524d1a05 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -2432,12 +2432,20 @@ _elm_genlist_item_focused(Elm_Gen_Item *it)
2432 (elm_widget_item_disabled_get(it))) 2432 (elm_widget_item_disabled_get(it)))
2433 return; 2433 return;
2434 2434
2435 if (!_elm_config->focus_auto_scroll_bring_in_enable) 2435 switch (_elm_config->focus_autoscroll_mode)
2436 elm_genlist_item_show((Elm_Object_Item *)it, 2436 {
2437 ELM_GENLIST_ITEM_SCROLLTO_IN); 2437 case ELM_FOCUS_AUTOSCROLL_MODE_SHOW:
2438 else 2438 elm_genlist_item_show((Elm_Object_Item *)it,
2439 elm_genlist_item_bring_in((Elm_Object_Item *)it,
2440 ELM_GENLIST_ITEM_SCROLLTO_IN); 2439 ELM_GENLIST_ITEM_SCROLLTO_IN);
2440 break;
2441 case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN:
2442 elm_genlist_item_bring_in((Elm_Object_Item *)it,
2443 ELM_GENLIST_ITEM_SCROLLTO_IN);
2444 break;
2445 default:
2446 break;
2447 }
2448
2441 sd->focused_item = (Elm_Object_Item *)it; 2449 sd->focused_item = (Elm_Object_Item *)it;
2442 2450
2443 if (elm_widget_focus_highlight_enabled_get(obj)) 2451 if (elm_widget_focus_highlight_enabled_get(obj))
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index 9ebe5a11f..fcaa40ec9 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -1094,10 +1094,17 @@ _elm_list_item_focused(Elm_List_Item *it)
1094 evas_object_geometry_get(sd->hit_rect, &sx, &sy, &sw, &sh); 1094 evas_object_geometry_get(sd->hit_rect, &sx, &sy, &sw, &sh);
1095 if ((x < sx) || (y < sy)|| ((x + w) > (sx + sw)) || ((y + h) > (sy + sh))) 1095 if ((x < sx) || (y < sy)|| ((x + w) > (sx + sw)) || ((y + h) > (sy + sh)))
1096 { 1096 {
1097 if (!_elm_config->focus_auto_scroll_bring_in_enable) 1097 switch (_elm_config->focus_autoscroll_mode)
1098 elm_list_item_show((Elm_Object_Item *)it); 1098 {
1099 else 1099 case ELM_FOCUS_AUTOSCROLL_MODE_SHOW:
1100 elm_list_item_bring_in((Elm_Object_Item *)it); 1100 elm_list_item_show((Elm_Object_Item *)it);
1101 break;
1102 case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN:
1103 elm_list_item_bring_in((Elm_Object_Item *)it);
1104 break;
1105 default:
1106 break;
1107 }
1101 } 1108 }
1102 sd->focused_item = (Elm_Object_Item *)it; 1109 sd->focused_item = (Elm_Object_Item *)it;
1103 if (elm_widget_focus_highlight_enabled_get(WIDGET(it))) 1110 if (elm_widget_focus_highlight_enabled_get(WIDGET(it)))
diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h
index 784823345..2ee65cfa0 100644
--- a/src/lib/elm_priv.h
+++ b/src/lib/elm_priv.h
@@ -234,7 +234,7 @@ struct _Elm_Config
234 unsigned char focus_highlight_clip_disable; /**< This shows disabled status of focus highlight clip feature. This value is false by default so the focus highlight is clipped. */ 234 unsigned char focus_highlight_clip_disable; /**< This shows disabled status of focus highlight clip feature. This value is false by default so the focus highlight is clipped. */
235 unsigned char focus_move_policy; /**< This show how the elementary focus is moved to another object. Focus can be moved by click or mouse_in. */ 235 unsigned char focus_move_policy; /**< This show how the elementary focus is moved to another object. Focus can be moved by click or mouse_in. */
236 unsigned char item_select_on_focus_disable; /**< This shows the disabled status of select on focus feature. This value is false by default so that select on focus feature is enabled by default.*/ 236 unsigned char item_select_on_focus_disable; /**< This shows the disabled status of select on focus feature. This value is false by default so that select on focus feature is enabled by default.*/
237 unsigned char focus_auto_scroll_bring_in_enable; /**< This shows the enabled status of focus auto scroll bring in feature. This is disabled by default.*/ 237 Elm_Focus_Autoscroll_Mode focus_autoscroll_mode; /**< This shows the focus auto scroll mode. By default, @c ELM_FOCUS_AUTOSCROLL_MODE_SHOW is set. */
238 int toolbar_shrink_mode; 238 int toolbar_shrink_mode;
239 unsigned char fileselector_expand_enable; 239 unsigned char fileselector_expand_enable;
240 unsigned char fileselector_double_tap_navigation_enable; 240 unsigned char fileselector_double_tap_navigation_enable;
diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c
index dc3b58935..5ad643a36 100644
--- a/src/lib/elm_toolbar.c
+++ b/src/lib/elm_toolbar.c
@@ -601,12 +601,20 @@ _elm_toolbar_item_focused(Elm_Toolbar_Item *it)
601 return; 601 return;
602 602
603 sd->focused_item = it; 603 sd->focused_item = it;
604 if (!_elm_config->focus_auto_scroll_bring_in_enable) 604 switch (_elm_config->focus_autoscroll_mode)
605 elm_toolbar_item_show((Elm_Object_Item *)it, 605 {
606 ELM_TOOLBAR_ITEM_SCROLLTO_IN); 606 case ELM_FOCUS_AUTOSCROLL_MODE_SHOW:
607 else 607 elm_toolbar_item_show((Elm_Object_Item *)it,
608 elm_toolbar_item_bring_in((Elm_Object_Item *)it,
609 ELM_TOOLBAR_ITEM_SCROLLTO_IN); 608 ELM_TOOLBAR_ITEM_SCROLLTO_IN);
609 break;
610 case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN:
611 elm_toolbar_item_bring_in((Elm_Object_Item *)it,
612 ELM_TOOLBAR_ITEM_SCROLLTO_IN);
613 break;
614 default:
615 break;
616 }
617
610 if (elm_widget_focus_highlight_enabled_get(obj)) 618 if (elm_widget_focus_highlight_enabled_get(obj))
611 { 619 {
612 edje_object_signal_emit 620 edje_object_signal_emit
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 96f385345..47f185550 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -645,10 +645,18 @@ _elm_widget_focus_region_show(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
645 645
646 if (_elm_scrollable_is(o) && !elm_widget_disabled_get(o)) 646 if (_elm_scrollable_is(o) && !elm_widget_disabled_get(o))
647 { 647 {
648 if (!_elm_config->focus_auto_scroll_bring_in_enable) 648 switch (_elm_config->focus_autoscroll_mode)
649 eo_do(o, elm_interface_scrollable_content_region_show(x, y, w, h)); 649 {
650 else 650 case ELM_FOCUS_AUTOSCROLL_MODE_SHOW:
651 eo_do(o, elm_interface_scrollable_region_bring_in(x, y, w, h)); 651 eo_do(o, elm_interface_scrollable_content_region_show(x, y, w, h));
652 break;
653 case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN:
654 eo_do(o, elm_interface_scrollable_region_bring_in(x, y, w, h));
655 break;
656 default:
657 break;
658 }
659
652 660
653 if (!elm_widget_focus_region_get(o, &x, &y, &w, &h)) 661 if (!elm_widget_focus_region_get(o, &x, &y, &w, &h))
654 { 662 {