From ab68723b60e13ef4b248b24d9a362098eb1a5ccc Mon Sep 17 00:00:00 2001 From: Jee-Yong Um Date: Tue, 7 Feb 2017 13:42:45 -0800 Subject: [PATCH] elm.entry: add configuration for the default value of select_allow Summary: Small devices (like smart watch) can disallow entry selection by default. This patch enables to control this behavior with elementary configuration. Reviewers: cedric, jpeg Subscribers: id213sin, woohyun Differential Revision: https://phab.enlightenment.org/D4615 Signed-off-by: Cedric BAIL --- src/lib/elementary/elm_config.c | 2 ++ src/lib/elementary/elm_entry.c | 4 ++-- src/lib/elementary/elm_priv.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c index c6cb7b5..a7f8547 100644 --- a/src/lib/elementary/elm_config.c +++ b/src/lib/elementary/elm_config.c @@ -506,6 +506,7 @@ _desc_init(void) ELM_CONFIG_VAL(D, T, popup_scrollable, T_UCHAR); ELM_CONFIG_VAL(D, T, spinner_min_max_filter_enable, T_UCHAR); ELM_CONFIG_VAL(D, T, icon_theme, T_STRING); + ELM_CONFIG_VAL(D, T, entry_select_allow, T_UCHAR); #undef T #undef D #undef T_INT @@ -1843,6 +1844,7 @@ _config_load(void) _elm_config->popup_vertical_align = 0.5; _elm_config->icon_theme = eina_stringshare_add(ELM_CONFIG_ICON_THEME_ELEMENTARY); _elm_config->popup_scrollable = EINA_FALSE; + _elm_config->entry_select_allow = EINA_TRUE; } static void diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c index dd71ffc..f90e9d7 100644 --- a/src/lib/elementary/elm_entry.c +++ b/src/lib/elementary/elm_entry.c @@ -3664,7 +3664,7 @@ _elm_entry_efl_canvas_group_group_add(Eo *obj, Elm_Entry_Data *priv) priv->context_menu = EINA_TRUE; priv->auto_save = EINA_TRUE; priv->editable = EINA_TRUE; - priv->sel_allow = EINA_TRUE; + priv->sel_allow = _elm_config->entry_select_allow; priv->drop_format = ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE; elm_drop_target_add(obj, priv->drop_format, @@ -3775,7 +3775,7 @@ _elm_entry_efl_canvas_group_group_add(Eo *obj, Elm_Entry_Data *priv) elm_object_sub_cursor_set (wd->resize_obj, obj, ELM_CURSOR_XTERM); elm_widget_can_focus_set(obj, EINA_TRUE); - if (_elm_config->desktop_entry) + if (priv->sel_allow && _elm_config->desktop_entry) edje_object_part_text_select_allow_set (priv->entry_edje, "elm.text", EINA_TRUE); diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h index 50fc906..ba35138 100644 --- a/src/lib/elementary/elm_priv.h +++ b/src/lib/elementary/elm_priv.h @@ -313,6 +313,7 @@ struct _Elm_Config int gl_stencil; int gl_msaa; const char *icon_theme; + unsigned char entry_select_allow; /* Not part of the EET file */ Eina_Bool is_mirrored : 1; -- 2.7.4