elm.entry: add configuration for the default value of select_allow
authorJee-Yong Um <jc9.um@samsung.com>
Tue, 7 Feb 2017 21:42:45 +0000 (13:42 -0800)
committerCedric BAIL <cedric@osg.samsung.com>
Tue, 7 Feb 2017 22:17:47 +0000 (14:17 -0800)
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 <cedric@osg.samsung.com>
src/lib/elementary/elm_config.c
src/lib/elementary/elm_entry.c
src/lib/elementary/elm_priv.h

index c6cb7b5..a7f8547 100644 (file)
@@ -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
index dd71ffc..f90e9d7 100644 (file)
@@ -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);
 
index 50fc906..ba35138 100644 (file)
@@ -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;