[GUI] Enforce virtual keyboard redisplay on clear
This commit is contained in:
parent
99fdf25613
commit
7b8d6d2413
2 changed files with 20 additions and 14 deletions
|
@ -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) {
|
show_virtual_keyboard();
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
show_virtual_keyboard();
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} 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 {
|
||||||
|
|
|
@ -242,6 +242,9 @@ public:
|
||||||
Ref<Texture> get_right_icon();
|
Ref<Texture> get_right_icon();
|
||||||
|
|
||||||
virtual bool is_text_field() const;
|
virtual bool is_text_field() const;
|
||||||
|
|
||||||
|
void show_virtual_keyboard();
|
||||||
|
|
||||||
LineEdit();
|
LineEdit();
|
||||||
~LineEdit();
|
~LineEdit();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue