summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAmitesh Singh <amitesh.sh@samsung.com>2014-04-27 04:15:26 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-04-27 04:15:26 +0900
commitd1b0e5c94e9148ce281d2b62309c19482a654e31 (patch)
tree8f55a0887f3531b31a8645497013394cc41a7cdc /src/lib
parent26ad9b6bac7447445a9bfcfc1befc5a6d44dfee5 (diff)
config: Added two APIs to enable/disable focus auto scroll bring in feature.
Summary: Summary: - APIs - elm_config_focus_auto_scroll_bring_in_enabled_set - elm_config_focus_auto_scroll_bring_in_enabled_get - list/genlist/toolbar/gengrid: Using this feature for scrolling for focus movement. - Added test case in "List Focus", "Genlist Focus", "Toolbar Focus" and "Gengrid Focus" @feature Test Plan: elementary_test->"List Focus", "Genlist Focus", "Toolbar Focus" & "Gengrid Focus". Reviewers: raster, seoz CC: seoz Differential Revision: https://phab.enlightenment.org/D799
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/elm_config.c16
-rw-r--r--src/lib/elm_config.h20
-rw-r--r--src/lib/elm_gengrid.c8
-rw-r--r--src/lib/elm_genlist.c7
-rw-r--r--src/lib/elm_list.c7
-rw-r--r--src/lib/elm_priv.h1
-rw-r--r--src/lib/elm_toolbar.c7
7 files changed, 61 insertions, 5 deletions
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index f80a62b97..59e287fb9 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -507,6 +507,7 @@ _desc_init(void)
507 ELM_CONFIG_VAL(D, T, scroll_smooth_history_weight, T_DOUBLE); 507 ELM_CONFIG_VAL(D, T, scroll_smooth_history_weight, T_DOUBLE);
508 ELM_CONFIG_VAL(D, T, scroll_smooth_future_time, T_DOUBLE); 508 ELM_CONFIG_VAL(D, T, scroll_smooth_future_time, T_DOUBLE);
509 ELM_CONFIG_VAL(D, T, scroll_smooth_time_window, T_DOUBLE); 509 ELM_CONFIG_VAL(D, T, scroll_smooth_time_window, T_DOUBLE);
510 ELM_CONFIG_VAL(D, T, focus_auto_scroll_bring_in_enable, T_UCHAR);
510 ELM_CONFIG_VAL(D, T, scale, T_DOUBLE); 511 ELM_CONFIG_VAL(D, T, scale, T_DOUBLE);
511 ELM_CONFIG_VAL(D, T, bgpixmap, T_INT); 512 ELM_CONFIG_VAL(D, T, bgpixmap, T_INT);
512 ELM_CONFIG_VAL(D, T, compositing, T_INT); 513 ELM_CONFIG_VAL(D, T, compositing, T_INT);
@@ -2027,6 +2028,9 @@ _env_get(void)
2027 if (s) _elm_config->scroll_smooth_future_time = _elm_atof(s); 2028 if (s) _elm_config->scroll_smooth_future_time = _elm_atof(s);
2028 s = getenv("ELM_SCROLL_SMOOTH_TIME_WINDOW"); 2029 s = getenv("ELM_SCROLL_SMOOTH_TIME_WINDOW");
2029 if (s) _elm_config->scroll_smooth_time_window = _elm_atof(s); 2030 if (s) _elm_config->scroll_smooth_time_window = _elm_atof(s);
2031 s = getenv("ELM_FOCUS_AUTO_SCROLL_BRING_IN_ENABLE");
2032 if (s) _elm_config->focus_auto_scroll_bring_in_enable = !!atoi(s);
2033
2030 s = getenv("ELM_THEME"); 2034 s = getenv("ELM_THEME");
2031 if (s) eina_stringshare_replace(&_elm_config->theme, s); 2035 if (s) eina_stringshare_replace(&_elm_config->theme, s);
2032 2036
@@ -2923,6 +2927,18 @@ elm_config_scroll_thumbscroll_acceleration_weight_set(double weight)
2923 _elm_config->thumbscroll_acceleration_weight = weight; 2927 _elm_config->thumbscroll_acceleration_weight = weight;
2924} 2928}
2925 2929
2930EAPI Eina_Bool
2931elm_config_focus_auto_scroll_bring_in_enabled_get(void)
2932{
2933 return _elm_config->focus_auto_scroll_bring_in_enable;
2934}
2935
2936EAPI void
2937elm_config_focus_auto_scroll_bring_in_enabled_set(Eina_Bool enabled)
2938{
2939 _elm_config->focus_auto_scroll_bring_in_enable = !!enabled;
2940}
2941
2926EAPI void 2942EAPI void
2927elm_config_longpress_timeout_set(double longpress_timeout) 2943elm_config_longpress_timeout_set(double longpress_timeout)
2928{ 2944{
diff --git a/src/lib/elm_config.h b/src/lib/elm_config.h
index 4478068d2..c95818653 100644
--- a/src/lib/elm_config.h
+++ b/src/lib/elm_config.h
@@ -551,6 +551,26 @@ 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.
555 *
556 * @see elm_config_focus_auto_scroll_bring_in_enabled_set()
557 * @ingroup Focus
558 * @since 1.10
559 */
560EAPI Eina_Bool elm_config_focus_auto_scroll_bring_in_enabled_get(void);
561
562/**
563 * Set enable status of focus auto scroll bring in.
564 *
565 * @param enabled enable scroll bring in if @c EINA_TRUE, disable otherwise
566 *
567 * @see elm_config_focus_auto_scroll_bring_in_enabled_get()
568 * @ingroup Focus
569 * @since 1.10
570 */
571EAPI void elm_config_focus_auto_scroll_bring_in_enabled_set(Eina_Bool enabled);
572
573/**
554 * @} 574 * @}
555 */ 575 */
556 576
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index dd30714cc..bfcecaebf 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -1487,8 +1487,12 @@ _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 elm_gengrid_item_show 1490 if (!_elm_config->focus_auto_scroll_bring_in_enable)
1491 ((Elm_Object_Item *)it, ELM_GENGRID_ITEM_SCROLLTO_IN); 1491 elm_gengrid_item_show
1492 ((Elm_Object_Item *)it, ELM_GENGRID_ITEM_SCROLLTO_IN);
1493 else
1494 elm_gengrid_item_bring_in
1495 ((Elm_Object_Item *)it, ELM_GENGRID_ITEM_SCROLLTO_IN);
1492 sd->focused_item = (Elm_Object_Item *)it; 1496 sd->focused_item = (Elm_Object_Item *)it;
1493 1497
1494 if (elm_widget_focus_highlight_enabled_get(obj)) 1498 if (elm_widget_focus_highlight_enabled_get(obj))
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index bf9298f0f..22785bac5 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -2432,7 +2432,12 @@ _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 elm_genlist_item_show((Elm_Object_Item *)it, ELM_GENLIST_ITEM_SCROLLTO_IN); 2435 if (!_elm_config->focus_auto_scroll_bring_in_enable)
2436 elm_genlist_item_show((Elm_Object_Item *)it,
2437 ELM_GENLIST_ITEM_SCROLLTO_IN);
2438 else
2439 elm_genlist_item_bring_in((Elm_Object_Item *)it,
2440 ELM_GENLIST_ITEM_SCROLLTO_IN);
2436 sd->focused_item = (Elm_Object_Item *)it; 2441 sd->focused_item = (Elm_Object_Item *)it;
2437 2442
2438 if (elm_widget_focus_highlight_enabled_get(obj)) 2443 if (elm_widget_focus_highlight_enabled_get(obj))
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index fd5def28b..aeb91ae88 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -1081,7 +1081,12 @@ _elm_list_item_focused(Elm_List_Item *it)
1081 evas_object_geometry_get(VIEW(it), &x, &y, &w, &h); 1081 evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
1082 evas_object_geometry_get(sd->hit_rect, &sx, &sy, &sw, &sh); 1082 evas_object_geometry_get(sd->hit_rect, &sx, &sy, &sw, &sh);
1083 if ((x < sx) || (y < sy)|| ((x + w) > (sx + sw)) || ((y + h) > (sy + sh))) 1083 if ((x < sx) || (y < sy)|| ((x + w) > (sx + sw)) || ((y + h) > (sy + sh)))
1084 elm_list_item_show((Elm_Object_Item *)it); 1084 {
1085 if (!_elm_config->focus_auto_scroll_bring_in_enable)
1086 elm_list_item_show((Elm_Object_Item *)it);
1087 else
1088 elm_list_item_bring_in((Elm_Object_Item *)it);
1089 }
1085 sd->focused_item = (Elm_Object_Item *)it; 1090 sd->focused_item = (Elm_Object_Item *)it;
1086 if (elm_widget_focus_highlight_enabled_get(WIDGET(it))) 1091 if (elm_widget_focus_highlight_enabled_get(WIDGET(it)))
1087 { 1092 {
diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h
index 86afbed21..784823345 100644
--- a/src/lib/elm_priv.h
+++ b/src/lib/elm_priv.h
@@ -234,6 +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 int toolbar_shrink_mode; 238 int toolbar_shrink_mode;
238 unsigned char fileselector_expand_enable; 239 unsigned char fileselector_expand_enable;
239 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 455e94a20..45b61c29e 100644
--- a/src/lib/elm_toolbar.c
+++ b/src/lib/elm_toolbar.c
@@ -601,7 +601,12 @@ _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 elm_toolbar_item_show((Elm_Object_Item *)it, ELM_TOOLBAR_ITEM_SCROLLTO_IN); 604 if (!_elm_config->focus_auto_scroll_bring_in_enable)
605 elm_toolbar_item_show((Elm_Object_Item *)it,
606 ELM_TOOLBAR_ITEM_SCROLLTO_IN);
607 else
608 elm_toolbar_item_bring_in((Elm_Object_Item *)it,
609 ELM_TOOLBAR_ITEM_SCROLLTO_IN);
605 if (elm_widget_focus_highlight_enabled_get(obj)) 610 if (elm_widget_focus_highlight_enabled_get(obj))
606 { 611 {
607 edje_object_signal_emit 612 edje_object_signal_emit