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
}
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)
{
Widget_Data *wd = elm_widget_data_get(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
{
/* 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
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);
+}
+
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.
*
* This can be necessary in the case where modifying the buffer would confuse on-going input method behavior