summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2020-01-13 12:46:57 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2020-01-13 12:46:57 +0900
commit3249b53d1cc9f9e82f33e84151d9b6775ad9c184 (patch)
tree592d96b8e03244c0f1ff6b16f18f3a1958045efe
parent3fc78f69eb095e65c2be0bd172dd49d49b5b837f (diff)
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
-rw-r--r--src/lib/elementary/efl_ui_internal_text_interactive.c8
1 files 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
1116 { 1116 {
1117 if (multiline) 1117 if (multiline)
1118 { 1118 {
1119 if (shift || efl_canvas_textblock_newline_as_paragraph_separator_get(obj)) 1119 //FIXME this should be Fixed when multiline set works fine with PARAGRAPH_SEPARATOR
1120 //Now only \n can work with multiline set
1121 //if (shift || efl_canvas_textblock_newline_as_paragraph_separator_get(obj))
1120 { 1122 {
1121 string = "\n"; 1123 string = "\n";
1122 } 1124 }
1123 else 1125 /*else
1124 { 1126 {
1125 string = _PARAGRAPH_SEPARATOR_UTF8; 1127 string = _PARAGRAPH_SEPARATOR_UTF8;
1126 } 1128 }*/
1127 } 1129 }
1128 } 1130 }
1129 1131