Fix return key disable demo 87/95987/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 7 Nov 2016 08:27:10 +0000 (17:27 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 7 Nov 2016 08:27:16 +0000 (17:27 +0900)
Return key should be disabled according to the length of content not cursor position.

Change-Id: Ie298f699968a903f6bea3b04f42b546389f161e9
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
ism/demos/isf_return_key_disable_efl.cpp

index fb3c120..061ffdf 100644 (file)
@@ -35,21 +35,6 @@ static void autotest_add_demo_return_key_disable(struct appdata *ad);
 static std::vector<Evas_Object*> _return_key_disable_entries;
 static std::vector<std::string> _return_key_disable_titles;
 
-static void
-_cursor_changed_cb (void *data, Evas_Object *obj, void *event_info)
-{
-    Evas_Object *en = obj;
-
-    int pos = elm_entry_cursor_pos_get (en);
-
-    if (pos == 0) {
-        elm_entry_input_panel_return_key_disabled_set (en, EINA_TRUE);
-    }
-    else {
-        elm_entry_input_panel_return_key_disabled_set (en, EINA_FALSE);
-    }
-}
-
 static Evas_Object *_create_ef_layout (Evas_Object *parent, const char *label, const char *guide_text, Elm_Input_Panel_Layout layout, Elm_Input_Panel_Return_Key_Type return_key_type)
 {
     Evas_Object *en;
@@ -58,9 +43,7 @@ static Evas_Object *_create_ef_layout (Evas_Object *parent, const char *label, c
 
     elm_entry_input_panel_layout_set (en, layout);
     elm_entry_input_panel_return_key_type_set (en, return_key_type);
-
-    evas_object_smart_callback_add (en, "cursor,changed", _cursor_changed_cb, NULL);
-    evas_object_smart_callback_add (en, "focused", _cursor_changed_cb, NULL);
+    elm_entry_input_panel_return_key_autoenabled_set (en, EINA_TRUE);
 
     _return_key_disable_entries.push_back(en);
     _return_key_disable_titles.push_back(label);