|
@@ -128,13 +128,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
|
|
selection.creating = false;
|
|
selection.creating = false;
|
|
selection.doubleclick = false;
|
|
selection.doubleclick = false;
|
|
|
|
|
|
- if (OS::get_singleton()->has_virtual_keyboard() && virtual_keyboard_enabled) {
|
|
|
|
- if (selection.enabled) {
|
|
|
|
- OS::get_singleton()->show_virtual_keyboard(text, get_global_rect(), false, max_length, selection.begin, selection.end);
|
|
|
|
- } else {
|
|
|
|
- OS::get_singleton()->show_virtual_keyboard(text, get_global_rect(), false, max_length, cursor_pos);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ show_virtual_keyboard();
|
|
}
|
|
}
|
|
|
|
|
|
update();
|
|
update();
|
|
@@ -930,13 +924,7 @@ void LineEdit::_notification(int p_what) {
|
|
OS::get_singleton()->set_ime_position(get_global_position() + cursor_pos2);
|
|
OS::get_singleton()->set_ime_position(get_global_position() + cursor_pos2);
|
|
}
|
|
}
|
|
|
|
|
|
- if (OS::get_singleton()->has_virtual_keyboard() && virtual_keyboard_enabled) {
|
|
|
|
- if (selection.enabled) {
|
|
|
|
- OS::get_singleton()->show_virtual_keyboard(text, get_global_rect(), false, max_length, selection.begin, selection.end);
|
|
|
|
- } else {
|
|
|
|
- OS::get_singleton()->show_virtual_keyboard(text, get_global_rect(), false, max_length, cursor_pos);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ show_virtual_keyboard();
|
|
} break;
|
|
} break;
|
|
case NOTIFICATION_FOCUS_EXIT: {
|
|
case NOTIFICATION_FOCUS_EXIT: {
|
|
|
|
|
|
@@ -1277,6 +1265,21 @@ void LineEdit::clear() {
|
|
|
|
|
|
clear_internal();
|
|
clear_internal();
|
|
_text_changed();
|
|
_text_changed();
|
|
|
|
+
|
|
|
|
+ // This should reset virtual keyboard state if needed.
|
|
|
|
+ if (has_focus()) {
|
|
|
|
+ show_virtual_keyboard();
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void LineEdit::show_virtual_keyboard() {
|
|
|
|
+ if (OS::get_singleton()->has_virtual_keyboard() && virtual_keyboard_enabled) {
|
|
|
|
+ if (selection.enabled) {
|
|
|
|
+ OS::get_singleton()->show_virtual_keyboard(text, get_global_rect(), false, max_length, selection.begin, selection.end);
|
|
|
|
+ } else {
|
|
|
|
+ OS::get_singleton()->show_virtual_keyboard(text, get_global_rect(), false, max_length, cursor_pos);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
String LineEdit::get_text() const {
|
|
String LineEdit::get_text() const {
|