elm_object_item_disabled_set(data, EINA_TRUE);
}
+static void
+test_toolbar_focus_focus_move_policy_changed(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ int val = elm_radio_value_get(obj);
+
+ if (val == 0)
+ elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_CLICK);
+ else if (val == 1)
+ elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_IN);
+}
+
void
test_toolbar_focus(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- Evas_Object *win, *bx, *toolbar, *fr, *btn, *bx_opt, *chk;
+ Evas_Object *win, *bx, *toolbar, *fr, *btn, *bx_opt, *chk, *bx_mv, *rd, *rdg;
Elm_Object_Item *tb_it, *it_0, *it_3;
win = elm_win_util_standard_add("toolbar-focus", "Toolbar Focus");
evas_object_smart_callback_add(chk, "changed",
_test_toolbar_focus_focus_animate_check_changed,
win);
+ // Focus movement policy
+ fr = elm_frame_add(bx);
+ elm_object_text_set(fr, "Focus Movement Policy");
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_box_pack_end(bx, fr);
+ evas_object_show(fr);
+
+ bx_mv = elm_box_add(fr);
+ elm_box_horizontal_set(bx_mv, EINA_TRUE);
+ elm_object_content_set(fr, bx_mv);
+ evas_object_show(bx_mv);
+
+ rdg = rd = elm_radio_add(bx_mv);
+ elm_object_text_set(rd, "Focus Move by Click");
+ elm_radio_state_value_set(rd, 0);
+ evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
+ evas_object_smart_callback_add(rd, "changed",
+ test_toolbar_focus_focus_move_policy_changed,
+ NULL);
+ elm_box_pack_end(bx_mv, rd);
+ evas_object_show(rd);
+
+ rd = elm_radio_add(bx_mv);
+ elm_object_text_set(rd, "Focus Move by Mouse-In");
+ elm_radio_group_add(rd, rdg);
+ elm_radio_state_value_set(rd, 1);
+ evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
+ evas_object_smart_callback_add(rd, "changed",
+ test_toolbar_focus_focus_move_policy_changed,
+ NULL);
+ elm_box_pack_end(bx_mv, rd);
+ evas_object_show(rd);
+
fr = elm_frame_add(bx);
elm_object_text_set(fr, "Focus");
evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);