value "longpress_timeout" double: 1.0;
value "effect_enable" uchar: 1;
value "desktop_entry" uchar: 0;
+ value "context_menu_disabled" uchar: 0;
value "password_show_last" uchar: 0;
value "password_show_last_timeout" double: 2.0;
value "glayer_zoom_finger_enable" uchar: 1;
value "longpress_timeout" double: 1.0;
value "effect_enable" uchar: 1;
value "desktop_entry" uchar: 0;
+ value "context_menu_disabled" uchar: 0;
value "password_show_last" uchar: 1;
value "password_show_last_timeout" double: 2.0;
value "glayer_zoom_finger_enable" uchar: 1;
value "longpress_timeout" double: 1.0;
value "effect_enable" uchar: 1;
value "desktop_entry" uchar: 1;
+ value "context_menu_disabled" uchar: 1;
value "password_show_last" uchar: 0;
value "password_show_last_timeout" double: 2.0;
value "glayer_zoom_finger_enable" uchar: 1;
elm_entry_editable_set(en, !elm_entry_editable_get(en));
}
+static void
+changed_cb1(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ Evas_Object *ck = data;
+ printf("ck %p to %i\n", obj, elm_check_state_get(obj));
+ elm_config_context_menu_disabled_set(elm_check_state_get(obj));
+ printf("ck2 %p is now %i\n", ck, elm_check_state_get(ck));
+}
+
void
test_entry(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- Evas_Object *win, *bx, *bx2, *bt, *en;
+ Evas_Object *win, *bx, *bx2, *bt, *en, *ck;
char buf[4096];
win = elm_win_util_standard_add("entry", "Entry");
elm_object_focus_allow_set(bt, EINA_FALSE);
evas_object_show(bt);
+ ck = elm_check_add(win);
+ elm_object_text_set(ck, "Context Menu Disable");
+ evas_object_smart_callback_add(ck, "changed", changed_cb1, ck);
+ elm_box_pack_end(bx, ck);
+ evas_object_show(ck);
+
elm_box_pack_end(bx, bx2);
evas_object_show(bx2);
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_autoscroll_mode, T_UCHAR);
+ ELM_CONFIG_VAL(D, T, context_menu_disabled, T_UCHAR);
ELM_CONFIG_VAL(D, T, slider_indicator_visible_mode, T_INT);
ELM_CONFIG_VAL(D, T, item_select_on_focus_disable, T_UCHAR);
ELM_CONFIG_VAL(D, T, first_item_focus_on_first_focus_in, T_UCHAR);
_elm_config->longpress_timeout = 1.0;
_elm_config->effect_enable = EINA_TRUE;
_elm_config->desktop_entry = EINA_FALSE;
+ _elm_config->context_menu_disabled = EINA_FALSE;
_elm_config->is_mirrored = EINA_FALSE; /* Read sys value in env_get() */
_elm_config->password_show_last = EINA_FALSE;
_elm_config->password_show_last_timeout = 2.0;
s = getenv("ELM_ICON_SIZE");
if (s) _elm_config->icon_size = atoi(s);
+ s = getenv("ELM_CONTEXT_MENU_DISABLED");
+ if (s) _elm_config->context_menu_disabled = !!atoi(s);
+
s = getenv("ELM_LONGPRESS_TIMEOUT");
if (s) _elm_config->longpress_timeout = _elm_atof(s);
if (_elm_config->longpress_timeout < 0.0)
return _elm_config->thumbscroll_sensitivity_friction;
}
+EAPI Eina_Bool
+elm_config_context_menu_disabled_get(void)
+{
+ return _elm_config->context_menu_disabled;
+}
+
+EAPI void
+elm_config_context_menu_disabled_set(Eina_Bool enabled)
+{
+ _elm_config->context_menu_disabled = !!enabled;
+}
+
EAPI void
elm_config_scroll_thumbscroll_sensitivity_friction_set(double friction)
{
EAPI void elm_config_scroll_page_scroll_friction_set(double friction);
/**
+ * Get enable status of context menu disabled.
+ *
+ * @see elm_config_context_menu_disabled_set()
+ * @ingroup Entry
+ * @since 1.17
+ */
+EAPI Eina_Bool elm_config_context_menu_disabled_get(void);
+
+/**
+ * Set enable status of context menu disabled.
+ *
+ * @param enabled enable context menu if @c EINA_TRUE, disable otherwise
+ *
+ * @see elm_config_focus_auto_scroll_bring_in_enabled_get()
+ * @ingroup Entry
+ * @since 1.17
+ */
+EAPI void elm_config_context_menu_disabled_set(Eina_Bool enabled);
+
+/**
* Get the amount of inertia a scroller will impose at region bring
* animations.
*
_select_word(data, NULL, NULL);
elm_widget_scroll_freeze_push(data);
}
- if (!_elm_config->desktop_entry)
+ if (!_elm_config->context_menu_disabled &&
+ !_elm_config->desktop_entry)
{
_menu_call(data);
}
}
//
- else if (!_elm_config->desktop_entry)
+ /* Context menu will not appear if context menu disabled is set
+ * as false on a long press callback */
+ else if (!_elm_config->context_menu_disabled &&
+ !_elm_config->desktop_entry)
_menu_call(data);
}
if ((sd->api) && (sd->api->obj_hidemenu) && (!sd->sel_mode))
sd->api->obj_hidemenu(data);
//
- if (!strcmp(ev->key, "Menu"))
+ /* First check if context menu disabled is false or not, and
+ * then check for key id */
+ if ((!_elm_config->context_menu_disabled) && !strcmp(ev->key, "Menu"))
_menu_call(data);
}
sd->longpress_timer = ecore_timer_add
(_elm_config->longpress_timeout, _long_press_cb, data);
}
- else if (ev->button == 3)
+ /* If right button is pressed and context menu disabled is true,
+ * then only context menu will appear */
+ else if (ev->button == 3 && (!_elm_config->context_menu_disabled))
{
if (_elm_config->desktop_entry)
{
if (!_elm_config->desktop_entry && sd->have_selection && !sd->long_pressed)
elm_entry_select_none(data);
//
- //TIZEN_ONLY (20150806): Enable word selection when magnifier is disabled
- //if ((sd->long_pressed) && (_elm_config->magnifier_enable))
- // {
- // _magnifier_hide(data);
- if (sd->long_pressed)
+ /* Since context menu disabled flag was checked at long press start while mouse
+ * down, hence the same should be checked at mouse up from a long press
+ * as well */
+ /* TIZEN_ONLY (20150806): Enable word selection when magnifier is disabled
+ if ((sd->long_pressed) && (!_elm_config->context_menu_disabled) &&
+ (_elm_config->magnifier_enable))
+ {
+ _magnifier_hide(data);
+ */
+ if ((sd->long_pressed) && (!_elm_config->context_menu_disabled))
{
if (_elm_config->magnifier_enable)
_magnifier_hide(data);
}
//
}
- else if ((ev->button == 3) && (!_elm_config->desktop_entry))
+ /* Since context menu disabled flag was checked at mouse right key down,
+ * hence the same should be stopped at mouse up of right key as well */
+ else if ((ev->button == 3) && (!_elm_config->context_menu_disabled) &&
+ (!_elm_config->desktop_entry))
{
- sd->use_down = 1;
- _menu_call(data);
+ sd->use_down = 1;
+ _menu_call(data);
}
}
//
if (_elm_config->magnifier_enable)
_magnifier_hide(data);
- // TIZEN ONLY (20150205): Support CopyPaste UI
- /*if ((!_elm_config->desktop_entry) && (sd->long_pressed))
- _menu_call(data);*/
- if (!_elm_config->desktop_entry)
+ /* Context menu should not appear, even in case of selector mode, if the
+ * flag is false (disabled) */
+ /* TIZEN ONLY (20150205): Support CopyPaste UI
+ if ((!_elm_config->context_menu_disabled) &&
+ (!_elm_config->desktop_entry) && (sd->long_pressed))
+ */
+ if ((!_elm_config->context_menu_disabled) &&
+ (!_elm_config->desktop_entry))
_menu_call(data);
if (!_elm_config->desktop_entry)
edje_object_part_text_select_allow_set(sd->entry_edje, "elm.text",
//
if (_elm_config->magnifier_enable)
_magnifier_hide(data);
- // TIZEN ONLY (20150205): Support CopyPaste UI
- /*if ((!_elm_config->desktop_entry) && (sd->long_pressed))
- _menu_call(data);*/
- if (!_elm_config->desktop_entry)
+ /* Context menu appear was checked in case of selector start, and hence
+ * the same should be checked at selector end as well */
+ /* TIZEN ONLY (20150205): Support CopyPaste UI
+ if ((!_elm_config->context_menu_disabled) &&
+ (!_elm_config->desktop_entry) && (sd->long_pressed))
+ _menu_call(data);
+ */
+ if ((!_elm_config->context_menu_disabled) &&
+ (!_elm_config->desktop_entry))
_menu_call(data);
if (!_elm_config->desktop_entry)
edje_object_part_text_select_allow_set(sd->entry_edje, "elm.text",
double longpress_timeout;
unsigned char effect_enable;
unsigned char desktop_entry;
+ unsigned char context_menu_disabled;
unsigned char password_show_last;
double password_show_last_timeout;
unsigned char glayer_zoom_finger_enable;