forked from enlightenment/efl
focus: Change new API names related to focus auto scrolling.
elm_config_focus_auto_scroll_bring_in_enabled_get/set() -> elm_config_focus_autoscroll_mode_get/set() The main reason is that bring_in_enabled_get/set() APIs are too restricted and thus not flexible. I got more requirements for the focus autoscrolling such as none, wholely visible not just bring_in and show. So it is correct to add mode_set/get() APIs for the focus auto scrolling. Thanks god, we've found this before the release :) @feature
This commit is contained in:
parent
4f8614e866
commit
45e8b4c82e
|
@ -26,7 +26,7 @@ group "Elm_Config" struct {
|
|||
value "scroll_smooth_history_weight" double: 0.1;
|
||||
value "scroll_smooth_future_time" double: 0.0;
|
||||
value "scroll_smooth_time_window" double: 0.01;
|
||||
value "focus_auto_scroll_bring_in_enable" uchar: 0;
|
||||
value "focus_autoscroll_mode" uchar: 0;
|
||||
value "scale" double: 1.0;
|
||||
value "bgpixmap" int: 0;
|
||||
value "compositing" int: 1;
|
||||
|
|
|
@ -26,7 +26,7 @@ group "Elm_Config" struct {
|
|||
value "scroll_smooth_history_weight" double: 0.1;
|
||||
value "scroll_smooth_future_time" double: 0.0;
|
||||
value "scroll_smooth_time_window" double: 0.01;
|
||||
value "focus_auto_scroll_bring_in_enable" uchar: 0;
|
||||
value "focus_autoscroll_mode" uchar: 0;
|
||||
value "scale" double: 1.0;
|
||||
value "bgpixmap" int: 0;
|
||||
value "compositing" int: 1;
|
||||
|
|
|
@ -26,7 +26,7 @@ group "Elm_Config" struct {
|
|||
value "scroll_smooth_history_weight" double: 0.1;
|
||||
value "scroll_smooth_future_time" double: 0.0;
|
||||
value "scroll_smooth_time_window" double: 0.01;
|
||||
value "focus_auto_scroll_bring_in_enable" uchar: 0;
|
||||
value "focus_autoscroll_mode" uchar: 0;
|
||||
value "scale" double: 1.0;
|
||||
value "bgpixmap" int: 0;
|
||||
value "compositing" int: 1;
|
||||
|
|
|
@ -1590,18 +1590,6 @@ _config_focus_highlight_clip_cb(void *data EINA_UNUSED, Evas_Object *obj,
|
|||
elm_config_all_flush();
|
||||
}
|
||||
|
||||
static void
|
||||
_config_focus_auto_scroll_bring_in_cb(void *data EINA_UNUSED, Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Eina_Bool cf = elm_config_focus_auto_scroll_bring_in_enabled_get();
|
||||
Eina_Bool val = elm_check_state_get(obj);
|
||||
|
||||
if (cf == val) return;
|
||||
elm_config_focus_auto_scroll_bring_in_enabled_set(val);
|
||||
elm_config_all_flush();
|
||||
}
|
||||
|
||||
static void
|
||||
_config_focus_item_select_on_focus_cb(void *data EINA_UNUSED, Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
|
@ -1614,11 +1602,19 @@ _config_focus_item_select_on_focus_cb(void *data EINA_UNUSED, Evas_Object *obj,
|
|||
elm_config_all_flush();
|
||||
}
|
||||
|
||||
static void
|
||||
_status_config_focus_autoscroll_changed_cb(void *data EINA_UNUSED,
|
||||
Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
elm_config_focus_autoscroll_mode_set(elm_radio_value_get(obj));
|
||||
}
|
||||
|
||||
static void
|
||||
_status_config_focus(Evas_Object *win,
|
||||
Evas_Object *naviframe)
|
||||
{
|
||||
Evas_Object *bx, *ck;
|
||||
Evas_Object *bx, *ck, *fr;
|
||||
|
||||
bx = elm_box_add(win);
|
||||
|
||||
|
@ -1642,19 +1638,69 @@ _status_config_focus(Evas_Object *win,
|
|||
_config_focus_highlight_clip_cb, NULL);
|
||||
elm_check_state_set(ck, elm_config_focus_highlight_clip_disabled_get());
|
||||
|
||||
CHECK_ADD("Enable Auto Scroll Bring-in",
|
||||
"Set whether enable/disable auto scroll bring-in feature<br/>"
|
||||
"This is disabled by default so auto scrolling works by show not"
|
||||
"by bring-in.",
|
||||
_config_focus_auto_scroll_bring_in_cb, NULL);
|
||||
elm_check_state_set(ck, elm_config_focus_auto_scroll_bring_in_enabled_get());
|
||||
|
||||
CHECK_ADD("Disable Item Select on Focus",
|
||||
"Set whether item would be selected on item focus.<br/>"
|
||||
"This is enabled by default.",
|
||||
_config_focus_item_select_on_focus_cb, NULL);
|
||||
elm_check_state_set(ck, elm_config_item_select_on_focus_disabled_get());
|
||||
|
||||
fr = elm_frame_add(bx);
|
||||
elm_object_text_set(fr, "Focus Autoscroll Mode");
|
||||
evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, 0.5);
|
||||
elm_box_pack_end(bx, fr);
|
||||
evas_object_show(fr);
|
||||
{
|
||||
Evas_Object *bx2, *rdg, *rd;
|
||||
bx2 = elm_box_add(fr);
|
||||
elm_object_content_set(fr, bx2);
|
||||
evas_object_show(bx2);
|
||||
|
||||
rdg = rd = elm_radio_add(bx2);
|
||||
elm_radio_state_value_set(rd, ELM_FOCUS_AUTOSCROLL_MODE_SHOW);
|
||||
elm_object_text_set(rd, "ELM_FOCUS_AUTOSCROLL_MODE_SHOW");
|
||||
elm_object_tooltip_text_set(rd, "Directly show the focused region<br/>"
|
||||
"or item automatically inside a scroller.");
|
||||
evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(rd, 0.0, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(bx2, rd);
|
||||
evas_object_show(rd);
|
||||
evas_object_smart_callback_add(rd, "changed",
|
||||
_status_config_focus_autoscroll_changed_cb,
|
||||
NULL);
|
||||
|
||||
rd = elm_radio_add(bx2);
|
||||
elm_radio_state_value_set(rd, ELM_FOCUS_AUTOSCROLL_MODE_NONE);
|
||||
elm_object_text_set(rd, "ELM_FOCUS_AUTOSCROLL_MODE_NONE");
|
||||
elm_object_tooltip_text_set(rd, "Do not show the focused region or<br/>"
|
||||
"item automatically inside a scroller.");
|
||||
evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(rd, 0.0, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(bx2, rd);
|
||||
elm_radio_group_add(rd, rdg);
|
||||
evas_object_show(rd);
|
||||
evas_object_smart_callback_add(rd, "changed",
|
||||
_status_config_focus_autoscroll_changed_cb,
|
||||
NULL);
|
||||
|
||||
|
||||
rd = elm_radio_add(bx2);
|
||||
elm_radio_state_value_set(rd, ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN);
|
||||
elm_object_text_set(rd, "ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN");
|
||||
elm_object_tooltip_text_set(rd, "Bring in the focused region or item<br/>"
|
||||
"automatically which might invole the scrolling.");
|
||||
evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(rd, 0.0, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(bx2, rd);
|
||||
elm_radio_group_add(rd, rdg);
|
||||
evas_object_show(rd);
|
||||
evas_object_smart_callback_add(rd, "changed",
|
||||
_status_config_focus_autoscroll_changed_cb,
|
||||
NULL);
|
||||
|
||||
elm_radio_value_set(rdg, elm_config_focus_autoscroll_mode_get());
|
||||
}
|
||||
|
||||
evas_object_data_set(win, "focus", bx);
|
||||
|
||||
elm_naviframe_item_simple_push(naviframe, bx);
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#endif
|
||||
#include <Elementary.h>
|
||||
|
||||
Evas_Object * _focus_autoscroll_mode_frame_create(Evas_Object *parent);
|
||||
|
||||
static Elm_Gengrid_Item_Class *gic, *ggic;
|
||||
|
||||
Evas_Object *grid_content_get(void *data, Evas_Object *obj, const char *part);
|
||||
|
@ -1390,14 +1392,6 @@ _gg_focus_focus_animate_changed_cb(void *data,
|
|||
elm_check_state_get(obj));
|
||||
}
|
||||
|
||||
static void
|
||||
_gg_focus_bring_in_changed_cb(void *data EINA_UNUSED,
|
||||
Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
elm_config_focus_auto_scroll_bring_in_enabled_set(elm_check_state_get(obj));
|
||||
}
|
||||
|
||||
static void
|
||||
_grid_reorder_mode(void *data, Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
|
@ -1531,15 +1525,6 @@ test_gengrid_focus(void *data EINA_UNUSED,
|
|||
elm_box_pack_end(bx_opt, ck);
|
||||
evas_object_show(ck);
|
||||
|
||||
ck = elm_check_add(bx_opt);
|
||||
elm_object_text_set(ck, "Focus Auto scroll bring in enable");
|
||||
evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_smart_callback_add(ck, "changed", _gg_focus_bring_in_changed_cb,
|
||||
NULL);
|
||||
elm_check_state_set(ck, elm_config_focus_auto_scroll_bring_in_enabled_get());
|
||||
elm_box_pack_end(bx_opt, ck);
|
||||
evas_object_show(ck);
|
||||
|
||||
ck = elm_check_add(bx_opt);
|
||||
elm_object_text_set(ck, "Item Select on Focus disable");
|
||||
elm_check_state_set(ck, elm_config_item_select_on_focus_disabled_get());
|
||||
|
@ -1550,6 +1535,10 @@ test_gengrid_focus(void *data EINA_UNUSED,
|
|||
elm_box_pack_end(bx_opt, ck);
|
||||
evas_object_show(ck);
|
||||
|
||||
// Focus Autoscroll Mode
|
||||
fr = _focus_autoscroll_mode_frame_create(bx);
|
||||
elm_box_pack_end(bx, fr);
|
||||
|
||||
//Focus movement policy
|
||||
fr = elm_frame_add(bx);
|
||||
elm_object_text_set(fr, "Focus Movement Policy");
|
||||
|
|
|
@ -3807,12 +3807,75 @@ _focus_button_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
printf("Button clicked: %s\n", (char *)data);
|
||||
}
|
||||
|
||||
static void
|
||||
_gl_focus_bring_in_changed_cb(void *data EINA_UNUSED,
|
||||
Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
void
|
||||
_focus_autoscroll_changed_cb(void *data EINA_UNUSED,
|
||||
Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
elm_config_focus_auto_scroll_bring_in_enabled_set(elm_check_state_get(obj));
|
||||
elm_config_focus_autoscroll_mode_set(elm_radio_value_get(obj));
|
||||
}
|
||||
|
||||
/* this function is used in another tests such as list, gengrid, and toolbar. */
|
||||
Evas_Object *
|
||||
_focus_autoscroll_mode_frame_create(Evas_Object *parent)
|
||||
{
|
||||
Evas_Object *fr, *bx, *rdg, *rd;
|
||||
|
||||
fr = elm_frame_add(parent);
|
||||
elm_object_text_set(fr, "Focus Autoscroll Mode");
|
||||
evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, 0.5);
|
||||
evas_object_show(fr);
|
||||
|
||||
bx = elm_box_add(fr);
|
||||
elm_object_content_set(fr, bx);
|
||||
evas_object_show(bx);
|
||||
|
||||
rdg = rd = elm_radio_add(bx);
|
||||
elm_radio_state_value_set(rd, ELM_FOCUS_AUTOSCROLL_MODE_SHOW);
|
||||
elm_object_text_set(rd, "ELM_FOCUS_AUTOSCROLL_MODE_SHOW");
|
||||
elm_object_tooltip_text_set(rd, "Directly show the focused region<br/>"
|
||||
"or item automatically inside a scroller.");
|
||||
evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(rd, 0.0, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(bx, rd);
|
||||
evas_object_show(rd);
|
||||
evas_object_smart_callback_add(rd, "changed",
|
||||
_focus_autoscroll_changed_cb,
|
||||
NULL);
|
||||
|
||||
rd = elm_radio_add(bx);
|
||||
elm_radio_state_value_set(rd, ELM_FOCUS_AUTOSCROLL_MODE_NONE);
|
||||
elm_object_text_set(rd, "ELM_FOCUS_AUTOSCROLL_MODE_NONE");
|
||||
elm_object_tooltip_text_set(rd, "Do not show the focused region or<br/>"
|
||||
"item automatically inside a scroller.");
|
||||
evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(rd, 0.0, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(bx, rd);
|
||||
elm_radio_group_add(rd, rdg);
|
||||
evas_object_show(rd);
|
||||
evas_object_smart_callback_add(rd, "changed",
|
||||
_focus_autoscroll_changed_cb,
|
||||
NULL);
|
||||
|
||||
|
||||
rd = elm_radio_add(bx);
|
||||
elm_radio_state_value_set(rd, ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN);
|
||||
elm_object_text_set(rd, "ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN");
|
||||
elm_object_tooltip_text_set(rd, "Bring in the focused region or item<br/>"
|
||||
"automatically which might invole the scrolling.");
|
||||
evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(rd, 0.0, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(bx, rd);
|
||||
elm_radio_group_add(rd, rdg);
|
||||
evas_object_show(rd);
|
||||
evas_object_smart_callback_add(rd, "changed",
|
||||
_focus_autoscroll_changed_cb,
|
||||
NULL);
|
||||
|
||||
elm_radio_value_set(rdg, elm_config_focus_autoscroll_mode_get());
|
||||
|
||||
return fr;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -3978,15 +4041,6 @@ test_genlist_focus(void *data EINA_UNUSED,
|
|||
elm_box_pack_end(bx_opt, chk);
|
||||
evas_object_show(chk);
|
||||
|
||||
chk = elm_check_add(bx_opt);
|
||||
elm_object_text_set(chk, "Focus Auto scroll bring in enable");
|
||||
evas_object_size_hint_weight_set(chk, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_smart_callback_add(chk, "changed", _gl_focus_bring_in_changed_cb,
|
||||
NULL);
|
||||
elm_check_state_set(chk, elm_config_focus_auto_scroll_bring_in_enabled_get());
|
||||
elm_box_pack_end(bx_opt, chk);
|
||||
evas_object_show(chk);
|
||||
|
||||
chk = elm_check_add(bx_opt);
|
||||
elm_object_text_set(chk, "Item Select on Focus disable");
|
||||
elm_check_state_set(chk, elm_config_item_select_on_focus_disabled_get());
|
||||
|
@ -3997,6 +4051,10 @@ test_genlist_focus(void *data EINA_UNUSED,
|
|||
elm_box_pack_end(bx_opt, chk);
|
||||
evas_object_show(chk);
|
||||
|
||||
// Focus Autoscroll Mode
|
||||
fr = _focus_autoscroll_mode_frame_create(bx);
|
||||
elm_box_pack_end(bx, fr);
|
||||
|
||||
// Focus Movement Policy
|
||||
fr = elm_frame_add(bx);
|
||||
elm_object_text_set(fr, "Focus Movement Policy");
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#endif
|
||||
#include <Elementary.h>
|
||||
|
||||
Evas_Object * _focus_autoscroll_mode_frame_create(Evas_Object *parent);
|
||||
|
||||
struct _api_data
|
||||
{
|
||||
unsigned int state; /* What state we are testing */
|
||||
|
@ -1396,14 +1398,6 @@ _focus_button_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
printf("Button clicked: %s\n", (char *)data);
|
||||
}
|
||||
|
||||
static void
|
||||
_test_list_focus_bring_in_changed(void *data EINA_UNUSED,
|
||||
Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
elm_config_focus_auto_scroll_bring_in_enabled_set(elm_check_state_get(obj));
|
||||
}
|
||||
|
||||
static void
|
||||
_test_list_focus(const char *name, const char *title, Eina_Bool horiz)
|
||||
{
|
||||
|
@ -1540,14 +1534,9 @@ _test_list_focus(const char *name, const char *title, Eina_Bool horiz)
|
|||
elm_box_pack_end(bx_opt, chk);
|
||||
evas_object_show(chk);
|
||||
|
||||
chk = elm_check_add(bx_opt);
|
||||
elm_object_text_set(chk, "Focus Auto scroll bring in enable");
|
||||
evas_object_size_hint_weight_set(chk, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_smart_callback_add(chk, "changed", _test_list_focus_bring_in_changed,
|
||||
NULL);
|
||||
elm_check_state_set(chk, elm_config_focus_auto_scroll_bring_in_enabled_get());
|
||||
elm_box_pack_end(bx_opt, chk);
|
||||
evas_object_show(chk);
|
||||
// Focus Autoscroll Mode
|
||||
fr = _focus_autoscroll_mode_frame_create(bx);
|
||||
elm_box_pack_end(bx, fr);
|
||||
|
||||
// Focus Movement Policy
|
||||
fr = elm_frame_add(bx);
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
#endif
|
||||
#include <Elementary.h>
|
||||
|
||||
Evas_Object * _focus_autoscroll_mode_frame_create(Evas_Object *parent);
|
||||
|
||||
static void
|
||||
_tb_sel1_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
|
@ -1126,14 +1128,6 @@ test_toolbar_focus_focus_move_policy_changed(void *data EINA_UNUSED,
|
|||
elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_IN);
|
||||
}
|
||||
|
||||
static void
|
||||
_test_toolbar_focus_bring_in_changed(void *data EINA_UNUSED,
|
||||
Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
elm_config_focus_auto_scroll_bring_in_enabled_set(elm_check_state_get(obj));
|
||||
}
|
||||
|
||||
void
|
||||
test_toolbar_focus(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
|
@ -1221,14 +1215,9 @@ test_toolbar_focus(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
|
|||
_test_toolbar_focus_focus_animate_check_changed,
|
||||
win);
|
||||
|
||||
chk = elm_check_add(bx_opt);
|
||||
elm_object_text_set(chk, "Focus Auto scroll bring in enable");
|
||||
evas_object_size_hint_weight_set(chk, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_smart_callback_add(chk, "changed", _test_toolbar_focus_bring_in_changed,
|
||||
NULL);
|
||||
elm_check_state_set(chk, elm_config_focus_auto_scroll_bring_in_enabled_get());
|
||||
elm_box_pack_end(bx_opt, chk);
|
||||
evas_object_show(chk);
|
||||
// Focus Autoscroll Mode
|
||||
fr = _focus_autoscroll_mode_frame_create(bx);
|
||||
elm_box_pack_end(bx, fr);
|
||||
|
||||
// Focus movement policy
|
||||
fr = elm_frame_add(bx);
|
||||
|
|
|
@ -528,7 +528,7 @@ _desc_init(void)
|
|||
ELM_CONFIG_VAL(D, T, focus_highlight_animate, T_UCHAR);
|
||||
ELM_CONFIG_VAL(D, T, focus_highlight_clip_disable, T_UCHAR);
|
||||
ELM_CONFIG_VAL(D, T, focus_move_policy, T_UCHAR);
|
||||
ELM_CONFIG_VAL(D, T, focus_auto_scroll_bring_in_enable, T_UCHAR);
|
||||
ELM_CONFIG_VAL(D, T, focus_autoscroll_mode, T_UCHAR);
|
||||
ELM_CONFIG_VAL(D, T, item_select_on_focus_disable, T_UCHAR);
|
||||
ELM_CONFIG_VAL(D, T, toolbar_shrink_mode, T_INT);
|
||||
ELM_CONFIG_VAL(D, T, fileselector_expand_enable, T_UCHAR);
|
||||
|
@ -2027,8 +2027,16 @@ _env_get(void)
|
|||
if (s) _elm_config->scroll_smooth_future_time = _elm_atof(s);
|
||||
s = getenv("ELM_SCROLL_SMOOTH_TIME_WINDOW");
|
||||
if (s) _elm_config->scroll_smooth_time_window = _elm_atof(s);
|
||||
s = getenv("ELM_FOCUS_AUTO_SCROLL_BRING_IN_ENABLE");
|
||||
if (s) _elm_config->focus_auto_scroll_bring_in_enable = !!atoi(s);
|
||||
s = getenv("ELM_FOCUS_AUTOSCROLL_MODE");
|
||||
if (s)
|
||||
{
|
||||
if (!strcmp(s, "ELM_FOCUS_AUTOSCROLL_MODE_NONE"))
|
||||
_elm_config->focus_autoscroll_mode = ELM_FOCUS_AUTOSCROLL_MODE_NONE;
|
||||
else if (!strcmp(s, "ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN"))
|
||||
_elm_config->focus_autoscroll_mode = ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN;
|
||||
else
|
||||
_elm_config->focus_autoscroll_mode = ELM_FOCUS_AUTOSCROLL_MODE_SHOW;
|
||||
}
|
||||
|
||||
s = getenv("ELM_THEME");
|
||||
if (s) eina_stringshare_replace(&_elm_config->theme, s);
|
||||
|
@ -2926,16 +2934,16 @@ elm_config_scroll_thumbscroll_acceleration_weight_set(double weight)
|
|||
_elm_config->thumbscroll_acceleration_weight = weight;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_config_focus_auto_scroll_bring_in_enabled_get(void)
|
||||
EAPI Elm_Focus_Autoscroll_Mode
|
||||
elm_config_focus_autoscroll_mode_get(void)
|
||||
{
|
||||
return _elm_config->focus_auto_scroll_bring_in_enable;
|
||||
return _elm_config->focus_autoscroll_mode;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_config_focus_auto_scroll_bring_in_enabled_set(Eina_Bool enabled)
|
||||
elm_config_focus_autoscroll_mode_set(Elm_Focus_Autoscroll_Mode mode)
|
||||
{
|
||||
_elm_config->focus_auto_scroll_bring_in_enable = !!enabled;
|
||||
_elm_config->focus_autoscroll_mode = mode;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
|
|
@ -551,24 +551,48 @@ EAPI double elm_config_scroll_thumbscroll_acceleration_weight_get(void);
|
|||
EAPI void elm_config_scroll_thumbscroll_acceleration_weight_set(double weight);
|
||||
|
||||
/**
|
||||
* Get enable status of focus auto scroll bring in.
|
||||
* Focus Autoscroll Mode
|
||||
*
|
||||
* @see elm_config_focus_auto_scroll_bring_in_enabled_set()
|
||||
* @ingroup Focus
|
||||
* @since 1.10
|
||||
* @ingroup Focus
|
||||
*/
|
||||
EAPI Eina_Bool elm_config_focus_auto_scroll_bring_in_enabled_get(void);
|
||||
typedef enum
|
||||
{
|
||||
ELM_FOCUS_AUTOSCROLL_MODE_SHOW, /**< directly show the focused region or item automatically */
|
||||
ELM_FOCUS_AUTOSCROLL_MODE_NONE, /**< do not show the focused region or item automatically */
|
||||
ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN /**< bring_in the focused region or item automatically which might invole the scrolling */
|
||||
} Elm_Focus_Autoscroll_Mode;
|
||||
|
||||
/**
|
||||
* Set enable status of focus auto scroll bring in.
|
||||
* Get focus auto scroll mode.
|
||||
*
|
||||
* @param enabled enable scroll bring in if @c EINA_TRUE, disable otherwise
|
||||
* When a region or an item is focused and it resides inside any scroller,
|
||||
* elementary will automatically scroll the focused area to the visible
|
||||
* viewport.
|
||||
*
|
||||
* @see elm_config_focus_auto_scroll_bring_in_enabled_get()
|
||||
* @see elm_config_focus_autoscroll_mode_set()
|
||||
* @ingroup Focus
|
||||
* @since 1.10
|
||||
*/
|
||||
EAPI void elm_config_focus_auto_scroll_bring_in_enabled_set(Eina_Bool enabled);
|
||||
EAPI Elm_Focus_Autoscroll_Mode elm_config_focus_autoscroll_mode_get(void);
|
||||
|
||||
/**
|
||||
* Set focus auto scroll mode.
|
||||
*
|
||||
* @param mode focus auto scroll mode. This can be one of the
|
||||
* Elm_Focus_Autoscroll_Mode enum values.
|
||||
*
|
||||
* When a region or an item is focused and it resides inside any scroller,
|
||||
* elementary will automatically scroll the focused area to the visible
|
||||
* viewport.
|
||||
* Focus auto scroll mode is set to @c ELM_FOCUS_AUTOSCROLL_MODE_SHOW by
|
||||
* default historically.
|
||||
*
|
||||
* @see elm_config_focus_autoscroll_mode_get()
|
||||
* @ingroup Focus
|
||||
* @since 1.10
|
||||
*/
|
||||
EAPI void elm_config_focus_autoscroll_mode_set(Elm_Focus_Autoscroll_Mode mode);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
@ -1487,12 +1487,20 @@ _elm_gengrid_item_focused(Elm_Gen_Item *it)
|
|||
(elm_widget_item_disabled_get(it)))
|
||||
return;
|
||||
|
||||
if (!_elm_config->focus_auto_scroll_bring_in_enable)
|
||||
elm_gengrid_item_show
|
||||
switch (_elm_config->focus_autoscroll_mode)
|
||||
{
|
||||
case ELM_FOCUS_AUTOSCROLL_MODE_SHOW:
|
||||
elm_gengrid_item_show
|
||||
((Elm_Object_Item *)it, ELM_GENGRID_ITEM_SCROLLTO_IN);
|
||||
else
|
||||
elm_gengrid_item_bring_in
|
||||
break;
|
||||
case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN:
|
||||
elm_gengrid_item_bring_in
|
||||
((Elm_Object_Item *)it, ELM_GENGRID_ITEM_SCROLLTO_IN);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
sd->focused_item = (Elm_Object_Item *)it;
|
||||
|
||||
if (elm_widget_focus_highlight_enabled_get(obj))
|
||||
|
|
|
@ -2432,12 +2432,20 @@ _elm_genlist_item_focused(Elm_Gen_Item *it)
|
|||
(elm_widget_item_disabled_get(it)))
|
||||
return;
|
||||
|
||||
if (!_elm_config->focus_auto_scroll_bring_in_enable)
|
||||
elm_genlist_item_show((Elm_Object_Item *)it,
|
||||
ELM_GENLIST_ITEM_SCROLLTO_IN);
|
||||
else
|
||||
elm_genlist_item_bring_in((Elm_Object_Item *)it,
|
||||
switch (_elm_config->focus_autoscroll_mode)
|
||||
{
|
||||
case ELM_FOCUS_AUTOSCROLL_MODE_SHOW:
|
||||
elm_genlist_item_show((Elm_Object_Item *)it,
|
||||
ELM_GENLIST_ITEM_SCROLLTO_IN);
|
||||
break;
|
||||
case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN:
|
||||
elm_genlist_item_bring_in((Elm_Object_Item *)it,
|
||||
ELM_GENLIST_ITEM_SCROLLTO_IN);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
sd->focused_item = (Elm_Object_Item *)it;
|
||||
|
||||
if (elm_widget_focus_highlight_enabled_get(obj))
|
||||
|
|
|
@ -1094,10 +1094,17 @@ _elm_list_item_focused(Elm_List_Item *it)
|
|||
evas_object_geometry_get(sd->hit_rect, &sx, &sy, &sw, &sh);
|
||||
if ((x < sx) || (y < sy)|| ((x + w) > (sx + sw)) || ((y + h) > (sy + sh)))
|
||||
{
|
||||
if (!_elm_config->focus_auto_scroll_bring_in_enable)
|
||||
elm_list_item_show((Elm_Object_Item *)it);
|
||||
else
|
||||
elm_list_item_bring_in((Elm_Object_Item *)it);
|
||||
switch (_elm_config->focus_autoscroll_mode)
|
||||
{
|
||||
case ELM_FOCUS_AUTOSCROLL_MODE_SHOW:
|
||||
elm_list_item_show((Elm_Object_Item *)it);
|
||||
break;
|
||||
case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN:
|
||||
elm_list_item_bring_in((Elm_Object_Item *)it);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
sd->focused_item = (Elm_Object_Item *)it;
|
||||
if (elm_widget_focus_highlight_enabled_get(WIDGET(it)))
|
||||
|
|
|
@ -234,7 +234,7 @@ struct _Elm_Config
|
|||
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. */
|
||||
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. */
|
||||
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.*/
|
||||
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.*/
|
||||
Elm_Focus_Autoscroll_Mode focus_autoscroll_mode; /**< This shows the focus auto scroll mode. By default, @c ELM_FOCUS_AUTOSCROLL_MODE_SHOW is set. */
|
||||
int toolbar_shrink_mode;
|
||||
unsigned char fileselector_expand_enable;
|
||||
unsigned char fileselector_double_tap_navigation_enable;
|
||||
|
|
|
@ -601,12 +601,20 @@ _elm_toolbar_item_focused(Elm_Toolbar_Item *it)
|
|||
return;
|
||||
|
||||
sd->focused_item = it;
|
||||
if (!_elm_config->focus_auto_scroll_bring_in_enable)
|
||||
elm_toolbar_item_show((Elm_Object_Item *)it,
|
||||
ELM_TOOLBAR_ITEM_SCROLLTO_IN);
|
||||
else
|
||||
elm_toolbar_item_bring_in((Elm_Object_Item *)it,
|
||||
switch (_elm_config->focus_autoscroll_mode)
|
||||
{
|
||||
case ELM_FOCUS_AUTOSCROLL_MODE_SHOW:
|
||||
elm_toolbar_item_show((Elm_Object_Item *)it,
|
||||
ELM_TOOLBAR_ITEM_SCROLLTO_IN);
|
||||
break;
|
||||
case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN:
|
||||
elm_toolbar_item_bring_in((Elm_Object_Item *)it,
|
||||
ELM_TOOLBAR_ITEM_SCROLLTO_IN);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (elm_widget_focus_highlight_enabled_get(obj))
|
||||
{
|
||||
edje_object_signal_emit
|
||||
|
|
|
@ -645,10 +645,18 @@ _elm_widget_focus_region_show(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
|
|||
|
||||
if (_elm_scrollable_is(o) && !elm_widget_disabled_get(o))
|
||||
{
|
||||
if (!_elm_config->focus_auto_scroll_bring_in_enable)
|
||||
eo_do(o, elm_interface_scrollable_content_region_show(x, y, w, h));
|
||||
else
|
||||
eo_do(o, elm_interface_scrollable_region_bring_in(x, y, w, h));
|
||||
switch (_elm_config->focus_autoscroll_mode)
|
||||
{
|
||||
case ELM_FOCUS_AUTOSCROLL_MODE_SHOW:
|
||||
eo_do(o, elm_interface_scrollable_content_region_show(x, y, w, h));
|
||||
break;
|
||||
case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN:
|
||||
eo_do(o, elm_interface_scrollable_region_bring_in(x, y, w, h));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (!elm_widget_focus_region_get(o, &x, &y, &w, &h))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue