|
@@ -1740,7 +1740,7 @@ void TextEdit::_notification(int p_what) {
|
|
Point2 cursor_pos = Point2(cursor_get_column(), cursor_get_line()) * get_row_height();
|
|
Point2 cursor_pos = Point2(cursor_get_column(), cursor_get_line()) * get_row_height();
|
|
OS::get_singleton()->set_ime_position(get_global_position() + cursor_pos);
|
|
OS::get_singleton()->set_ime_position(get_global_position() + cursor_pos);
|
|
|
|
|
|
- if (OS::get_singleton()->has_virtual_keyboard())
|
|
|
|
|
|
+ if (OS::get_singleton()->has_virtual_keyboard() && virtual_keyboard_enabled)
|
|
OS::get_singleton()->show_virtual_keyboard(get_text(), get_global_rect(), true);
|
|
OS::get_singleton()->show_virtual_keyboard(get_text(), get_global_rect(), true);
|
|
} break;
|
|
} break;
|
|
case NOTIFICATION_FOCUS_EXIT: {
|
|
case NOTIFICATION_FOCUS_EXIT: {
|
|
@@ -1754,7 +1754,7 @@ void TextEdit::_notification(int p_what) {
|
|
ime_text = "";
|
|
ime_text = "";
|
|
ime_selection = Point2();
|
|
ime_selection = Point2();
|
|
|
|
|
|
- if (OS::get_singleton()->has_virtual_keyboard())
|
|
|
|
|
|
+ if (OS::get_singleton()->has_virtual_keyboard() && virtual_keyboard_enabled)
|
|
OS::get_singleton()->hide_virtual_keyboard();
|
|
OS::get_singleton()->hide_virtual_keyboard();
|
|
} break;
|
|
} break;
|
|
case MainLoop::NOTIFICATION_OS_IME_UPDATE: {
|
|
case MainLoop::NOTIFICATION_OS_IME_UPDATE: {
|
|
@@ -6961,6 +6961,10 @@ void TextEdit::set_shortcut_keys_enabled(bool p_enabled) {
|
|
_generate_context_menu();
|
|
_generate_context_menu();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void TextEdit::set_virtual_keyboard_enabled(bool p_enable) {
|
|
|
|
+ virtual_keyboard_enabled = p_enable;
|
|
|
|
+}
|
|
|
|
+
|
|
void TextEdit::set_selecting_enabled(bool p_enabled) {
|
|
void TextEdit::set_selecting_enabled(bool p_enabled) {
|
|
selecting_enabled = p_enabled;
|
|
selecting_enabled = p_enabled;
|
|
|
|
|
|
@@ -6978,6 +6982,10 @@ bool TextEdit::is_shortcut_keys_enabled() const {
|
|
return shortcut_keys_enabled;
|
|
return shortcut_keys_enabled;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+bool TextEdit::is_virtual_keyboard_enabled() const {
|
|
|
|
+ return virtual_keyboard_enabled;
|
|
|
|
+}
|
|
|
|
+
|
|
PopupMenu *TextEdit::get_menu() const {
|
|
PopupMenu *TextEdit::get_menu() const {
|
|
return menu;
|
|
return menu;
|
|
}
|
|
}
|
|
@@ -7039,6 +7047,8 @@ void TextEdit::_bind_methods() {
|
|
ClassDB::bind_method(D_METHOD("is_context_menu_enabled"), &TextEdit::is_context_menu_enabled);
|
|
ClassDB::bind_method(D_METHOD("is_context_menu_enabled"), &TextEdit::is_context_menu_enabled);
|
|
ClassDB::bind_method(D_METHOD("set_shortcut_keys_enabled", "enable"), &TextEdit::set_shortcut_keys_enabled);
|
|
ClassDB::bind_method(D_METHOD("set_shortcut_keys_enabled", "enable"), &TextEdit::set_shortcut_keys_enabled);
|
|
ClassDB::bind_method(D_METHOD("is_shortcut_keys_enabled"), &TextEdit::is_shortcut_keys_enabled);
|
|
ClassDB::bind_method(D_METHOD("is_shortcut_keys_enabled"), &TextEdit::is_shortcut_keys_enabled);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_virtual_keyboard_enabled", "enable"), &TextEdit::set_virtual_keyboard_enabled);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("is_virtual_keyboard_enabled"), &TextEdit::is_virtual_keyboard_enabled);
|
|
ClassDB::bind_method(D_METHOD("set_selecting_enabled", "enable"), &TextEdit::set_selecting_enabled);
|
|
ClassDB::bind_method(D_METHOD("set_selecting_enabled", "enable"), &TextEdit::set_selecting_enabled);
|
|
ClassDB::bind_method(D_METHOD("is_selecting_enabled"), &TextEdit::is_selecting_enabled);
|
|
ClassDB::bind_method(D_METHOD("is_selecting_enabled"), &TextEdit::is_selecting_enabled);
|
|
|
|
|
|
@@ -7136,6 +7146,7 @@ void TextEdit::_bind_methods() {
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "override_selected_font_color"), "set_override_selected_font_color", "is_overriding_selected_font_color");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "override_selected_font_color"), "set_override_selected_font_color", "is_overriding_selected_font_color");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "context_menu_enabled"), "set_context_menu_enabled", "is_context_menu_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "context_menu_enabled"), "set_context_menu_enabled", "is_context_menu_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shortcut_keys_enabled"), "set_shortcut_keys_enabled", "is_shortcut_keys_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shortcut_keys_enabled"), "set_shortcut_keys_enabled", "is_shortcut_keys_enabled");
|
|
|
|
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "virtual_keyboard_enabled"), "set_virtual_keyboard_enabled", "is_virtual_keyboard_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "selecting_enabled"), "set_selecting_enabled", "is_selecting_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "selecting_enabled"), "set_selecting_enabled", "is_selecting_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smooth_scrolling"), "set_smooth_scroll_enable", "is_smooth_scroll_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smooth_scrolling"), "set_smooth_scroll_enable", "is_smooth_scroll_enabled");
|
|
ADD_PROPERTY(PropertyInfo(Variant::REAL, "v_scroll_speed"), "set_v_scroll_speed", "get_v_scroll_speed");
|
|
ADD_PROPERTY(PropertyInfo(Variant::REAL, "v_scroll_speed"), "set_v_scroll_speed", "get_v_scroll_speed");
|