summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/lib/elm_entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/elementary/src/lib/elm_entry.c')
-rw-r--r--legacy/elementary/src/lib/elm_entry.c46
1 files changed, 44 insertions, 2 deletions
diff --git a/legacy/elementary/src/lib/elm_entry.c b/legacy/elementary/src/lib/elm_entry.c
index 0d0fea09b6..75395d85fa 100644
--- a/legacy/elementary/src/lib/elm_entry.c
+++ b/legacy/elementary/src/lib/elm_entry.c
@@ -47,6 +47,7 @@ struct _Widget_Data
47 Elm_Scroller_Policy policy_h, policy_v; 47 Elm_Scroller_Policy policy_h, policy_v;
48 Elm_Wrap_Type linewrap; 48 Elm_Wrap_Type linewrap;
49 Elm_Input_Panel_Layout input_panel_layout; 49 Elm_Input_Panel_Layout input_panel_layout;
50 Elm_Autocapital_Type autocapital_type;
50 Eina_Bool changed : 1; 51 Eina_Bool changed : 1;
51 Eina_Bool single_line : 1; 52 Eina_Bool single_line : 1;
52 Eina_Bool password : 1; 53 Eina_Bool password : 1;
@@ -64,6 +65,7 @@ struct _Widget_Data
64 Eina_Bool textonly : 1; 65 Eina_Bool textonly : 1;
65 Eina_Bool usedown : 1; 66 Eina_Bool usedown : 1;
66 Eina_Bool scroll : 1; 67 Eina_Bool scroll : 1;
68 Eina_Bool input_panel_enable : 1;
67}; 69};
68 70
69struct _Elm_Entry_Context_Menu_Item 71struct _Elm_Entry_Context_Menu_Item
@@ -518,6 +520,8 @@ _theme_hook(Evas_Object *obj)
518 if (elm_widget_disabled_get(obj)) 520 if (elm_widget_disabled_get(obj))
519 edje_object_signal_emit(wd->ent, "elm,state,disabled", "elm"); 521 edje_object_signal_emit(wd->ent, "elm,state,disabled", "elm");
520 edje_object_part_text_input_panel_layout_set(wd->ent, "elm.text", wd->input_panel_layout); 522 edje_object_part_text_input_panel_layout_set(wd->ent, "elm.text", wd->input_panel_layout);
523 edje_object_part_text_autocapital_type_set(wd->ent, "elm.text", wd->autocapital_type);
524 edje_object_part_text_input_panel_enabled_set(wd->ent, "elm.text", wd->input_panel_enable);
521 elm_entry_cursor_pos_set(obj, wd->cursor_pos); 525 elm_entry_cursor_pos_set(obj, wd->cursor_pos);
522 if (elm_widget_focus_get(obj)) 526 if (elm_widget_focus_get(obj))
523 edje_object_signal_emit(wd->ent, "elm,action,focus", "elm"); 527 edje_object_signal_emit(wd->ent, "elm,action,focus", "elm");
@@ -761,14 +765,16 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
761 { 765 {
762 evas_object_focus_set(wd->ent, EINA_TRUE); 766 evas_object_focus_set(wd->ent, EINA_TRUE);
763 edje_object_signal_emit(wd->ent, "elm,action,focus", "elm"); 767 edje_object_signal_emit(wd->ent, "elm,action,focus", "elm");
764 if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON); 768 if (top && wd->input_panel_enable)
769 elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
765 evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL); 770 evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
766 } 771 }
767 else 772 else
768 { 773 {
769 edje_object_signal_emit(wd->ent, "elm,action,unfocus", "elm"); 774 edje_object_signal_emit(wd->ent, "elm,action,unfocus", "elm");
770 evas_object_focus_set(wd->ent, EINA_FALSE); 775 evas_object_focus_set(wd->ent, EINA_FALSE);
771 if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF); 776 if (top && wd->input_panel_enable)
777 elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
772 evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL); 778 evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
773 } 779 }
774} 780}
@@ -2259,6 +2265,9 @@ elm_entry_add(Evas_Object *parent)
2259 2265
2260 elm_entry_input_panel_layout_set(obj, ELM_INPUT_PANEL_LAYOUT_NORMAL); 2266 elm_entry_input_panel_layout_set(obj, ELM_INPUT_PANEL_LAYOUT_NORMAL);
2261 2267
2268 wd->input_panel_enable = edje_object_part_text_input_panel_enabled_get(wd->ent, "elm.text");
2269 wd->autocapital_type = edje_object_part_text_autocapital_type_get(wd->ent, "elm.text");
2270
2262#ifdef HAVE_ELEMENTARY_X 2271#ifdef HAVE_ELEMENTARY_X
2263 top = elm_widget_top_get(obj); 2272 top = elm_widget_top_get(obj);
2264 if ((top) && (elm_win_xwindow_get(top))) 2273 if ((top) && (elm_win_xwindow_get(top)))
@@ -3255,3 +3264,36 @@ elm_entry_input_panel_layout_get(Evas_Object *obj)
3255 3264
3256 return wd->input_panel_layout; 3265 return wd->input_panel_layout;
3257} 3266}
3267
3268EAPI void
3269elm_entry_autocapital_type_set(Evas_Object *obj, Elm_Autocapital_Type autocapital_type)
3270{
3271 ELM_CHECK_WIDTYPE(obj, widtype);
3272 Widget_Data *wd = elm_widget_data_get(obj);
3273 if (!wd) return;
3274
3275 wd->autocapital_type = autocapital_type;
3276 edje_object_part_text_autocapital_type_set(wd->ent, "elm.text", autocapital_type);
3277}
3278
3279EAPI Elm_Autocapital_Type
3280elm_entry_autocapital_type_get(Evas_Object *obj)
3281{
3282 ELM_CHECK_WIDTYPE(obj, widtype) ELM_AUTOCAPITAL_TYPE_NONE;
3283 Widget_Data *wd = elm_widget_data_get(obj);
3284 if (!wd) return ELM_AUTOCAPITAL_TYPE_NONE;
3285
3286 return wd->autocapital_type;
3287}
3288
3289EAPI void
3290elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled)
3291{
3292 ELM_CHECK_WIDTYPE(obj, widtype);
3293 Widget_Data *wd = elm_widget_data_get(obj);
3294 if (!wd) return;
3295
3296 wd->input_panel_enable = enabled;
3297 edje_object_part_text_input_panel_enabled_set(wd->ent, "elm.text", enabled);
3298}
3299