elm/entry: add elm_entry_input_panel_return_key_autoenable_set API.
Set whether the return key on the input panel is disabled automatically when entry has no text. SVN revision: 68484
This commit is contained in:
parent
81ddf08bd5
commit
42365c1368
|
@ -75,6 +75,7 @@ struct _Widget_Data
|
|||
Eina_Bool input_panel_enable : 1;
|
||||
Eina_Bool prediction_allow : 1;
|
||||
Eina_Bool input_panel_return_key_disabled : 1;
|
||||
Eina_Bool autoreturnkey : 1;
|
||||
};
|
||||
|
||||
struct _Elm_Entry_Context_Menu_Item
|
||||
|
@ -790,6 +791,21 @@ _sizing_eval(Evas_Object *obj)
|
|||
_recalc_cursor_geometry(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_check_enable_return_key(Evas_Object *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Eina_Bool return_key_disabled = EINA_FALSE;
|
||||
if (!wd) return;
|
||||
|
||||
if (!wd->autoreturnkey) return;
|
||||
|
||||
if (elm_entry_is_empty(obj) == EINA_TRUE)
|
||||
return_key_disabled = EINA_TRUE;
|
||||
|
||||
elm_entry_input_panel_return_key_disabled_set(obj, return_key_disabled);
|
||||
}
|
||||
|
||||
static void
|
||||
_on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
|
||||
{
|
||||
|
@ -804,6 +820,7 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
|
|||
if (top && wd->input_panel_enable)
|
||||
elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
|
||||
evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
|
||||
_check_enable_return_key(obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1506,6 +1523,7 @@ _entry_changed_common_handling(void *data, const char *event)
|
|||
/* callback - this could call callbacks that delete the entry... thus...
|
||||
* any access to wd after this could be invalid */
|
||||
evas_object_smart_callback_call(data, event, NULL);
|
||||
_check_enable_return_key(data);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -3732,3 +3750,14 @@ elm_entry_input_panel_return_key_disabled_get(const Evas_Object *obj)
|
|||
return wd->input_panel_return_key_disabled;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_entry_input_panel_return_key_autoenable_set(Evas_Object *obj, Eina_Bool on)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
|
||||
wd->autoreturnkey = on;
|
||||
_check_enable_return_key(obj);
|
||||
}
|
||||
|
||||
|
|
|
@ -1276,6 +1276,18 @@ EAPI void elm_entry_input_panel_return_key_disabled_set(Evas_O
|
|||
*/
|
||||
EAPI Eina_Bool elm_entry_input_panel_return_key_disabled_get(const Evas_Object *obj);
|
||||
|
||||
/**
|
||||
* Set whether the return key on the input panel is disabled automatically when entry has no text.
|
||||
*
|
||||
* If @p on is EINA_TRUE, The return key on input panel is disabled when the entry has no text.
|
||||
* The return Key on the input panel is automatically enabled when the entry has text.
|
||||
* The default value is EINA_FALSE.
|
||||
*
|
||||
* @param obj The entry object
|
||||
* @param on If @p on is EINA_TRUE, the return key is automatically disabled when the entry has no text.
|
||||
*/
|
||||
EAPI void elm_entry_input_panel_return_key_autoenable_set(Evas_Object *obj, Eina_Bool on);
|
||||
|
||||
/**
|
||||
* Reset the input method context of the entry if needed.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue