Added option to set single line 19/317919/1
authorInhong Han <inhong1.han@samsung.com>
Fri, 10 Jan 2025 00:15:46 +0000 (09:15 +0900)
committerInhong Han <inhong1.han@samsung.com>
Fri, 10 Jan 2025 00:15:46 +0000 (09:15 +0900)
Change-Id: Ic65e363ce7d9ca32db6055778c7a4be0a2d49c1d

inc/w-input-selector.h
src/w-input-keyboard.cpp

index 346ccdce6f6907bbd1f854c13b6bfa6a7f6bcc41..3370c46b5ad80fcd4ec0f1298785d7980386e796 100644 (file)
@@ -123,6 +123,7 @@ struct _InputKeyboardData
        int max_text_length;
        int cursor_position_set;
        Elm_Input_Panel_Layout input_panel_layout;
+       Eina_Bool single_line;
 };
 typedef struct _InputKeyboardData InputKeyboardData;
 
index c5387f51c387c66a0fea1f51d1f055bd1c29731f..cb55ae95032cc9c0c44481078717ef012c1b3a4d 100644 (file)
@@ -110,6 +110,7 @@ bool input_keyboard_init(app_control_h app_control)
        char *max_text_length = NULL;
        char *cursor_position_set = NULL;
        char *input_panel_layout = NULL;
+       char *single_line = NULL;
 
        input_keyboard_deinit();
 
@@ -180,6 +181,17 @@ bool input_keyboard_init(app_control_h app_control)
        free(input_panel_layout);
        input_panel_layout = NULL;
 
+       // single line
+       ret = app_control_get_extra_data(app_control, "http://tizen.org/appcontrol/data/input_single_line", &single_line);
+       if (ret == APP_CONTROL_ERROR_NONE) {
+               if (single_line) {
+                       g_input_keyboard_data.single_line = atoi(single_line);
+               }
+       }
+
+       free(single_line);
+       single_line = NULL;
+
        return true;
 }
 
@@ -272,6 +284,7 @@ static Evas_Object *create_entry(Evas_Object *parent)
        elm_entry_entry_set(entry, g_input_keyboard_data.default_text.c_str());
        elm_entry_cursor_end_set(entry);
        elm_entry_input_panel_return_key_type_set(entry, g_input_keyboard_data.return_key_type);
+       elm_entry_single_line_set(entry, g_input_keyboard_data.single_line);
 
        if (g_input_keyboard_data.return_key_type == ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE) {
                evas_object_smart_callback_add(entry, "activated", enter_keydown_cb, NULL);