woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3249b53d1cc9f9e82f33e84151d9b6775ad9c184

commit 3249b53d1cc9f9e82f33e84151d9b6775ad9c184
Author: Ali Alzyod <ali198...@gmail.com>
Date:   Mon Jan 13 12:46:57 2020 +0900

    efl.ui.textbox: Enter on keyboard will add \n instead of paragraph separator
    
    Summary: Becuase multiline_set(false) does not work with paragraphs, if 
user insert text by keyboard with multible line, then set multiline into false, 
multilines will still shown to user.
    
    Test Plan:
    ```
    #define EFL_EO_API_SUPPORT 1
    #define EFL_BETA_API_SUPPORT 1
    #include <Efl_Ui.h>
    #include <Elementary.h>
    
    static void
    _multiline_click_callback(void *data, const Efl_Event *event EINA_UNUSED)
    {
       Eo *tb = (Eo*) data;
       efl_text_multiline_set(tb, !efl_text_multiline_get(tb));
    }
    
    static void
    _quit_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
    {
       efl_exit(0);
    }
    
    EAPI_MAIN void
    efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
    {
       Eo *win, *box;
    
       win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
                      efl_text_set(efl_added, "Hello world"),
                      efl_ui_win_autodel_set(efl_added, EINA_TRUE));
       efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _quit_cb, 
NULL);
       efl_gfx_entity_size_set(win, EINA_SIZE2D(400, 240));
    
       box = efl_add(EFL_UI_BOX_CLASS, win,
                     efl_content_set(win, efl_added),
                     efl_ui_layout_orientation_set(efl_added, 
EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
    
       Eo *tb = efl_add(EFL_UI_TEXTBOX_CLASS, box,
                efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0.9),
                efl_pack(box, efl_added));
    
       Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, box,
                 efl_text_set(efl_added, "multiline switch"),
                 efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0.1),
                 efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, 
_multiline_click_callback, tb),
                 efl_pack(box, efl_added));
    }
    EFL_MAIN()
    ```
    
    Reviewers: woohyun, segfaultxavi
    
    Reviewed By: woohyun
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D11070
---
 src/lib/elementary/efl_ui_internal_text_interactive.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c 
b/src/lib/elementary/efl_ui_internal_text_interactive.c
index 54b29f2712..35c6ad2eef 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -1116,14 +1116,16 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED, Evas_Object *obj, void
      {
         if (multiline)
           {
-             if (shift || 
efl_canvas_textblock_newline_as_paragraph_separator_get(obj))
+             //FIXME this should be Fixed when multiline set works fine with 
PARAGRAPH_SEPARATOR
+             //Now only \n can work with multiline set
+             //if (shift || 
efl_canvas_textblock_newline_as_paragraph_separator_get(obj))
                {
                   string = "\n";
                }
-             else
+             /*else
                {
                   string = _PARAGRAPH_SEPARATOR_UTF8;
-               }
+               }*/
           }
      }
 

-- 


Reply via email to