|
@@ -45,6 +45,10 @@
|
|
|
#endif
|
|
|
|
|
|
void LineEdit::edit() {
|
|
|
+ _edit(true);
|
|
|
+}
|
|
|
+
|
|
|
+void LineEdit::_edit(bool p_show_virtual_keyboard) {
|
|
|
if (!is_inside_tree()) {
|
|
|
return;
|
|
|
}
|
|
@@ -70,7 +74,9 @@ void LineEdit::edit() {
|
|
|
editing = true;
|
|
|
_validate_caret_can_draw();
|
|
|
|
|
|
- show_virtual_keyboard();
|
|
|
+ if (p_show_virtual_keyboard) {
|
|
|
+ show_virtual_keyboard();
|
|
|
+ }
|
|
|
queue_redraw();
|
|
|
}
|
|
|
|
|
@@ -1579,7 +1585,7 @@ void LineEdit::_notification(int p_what) {
|
|
|
case NOTIFICATION_FOCUS_ENTER: {
|
|
|
// Only allow editing if the LineEdit is not focused with arrow keys.
|
|
|
if (!(Input::get_singleton()->is_action_pressed("ui_up") || Input::get_singleton()->is_action_pressed("ui_down") || Input::get_singleton()->is_action_pressed("ui_left") || Input::get_singleton()->is_action_pressed("ui_right"))) {
|
|
|
- edit();
|
|
|
+ _edit(virtual_keyboard_show_on_focus);
|
|
|
emit_signal(SNAME("editing_toggled"), true);
|
|
|
}
|
|
|
} break;
|
|
@@ -2720,6 +2726,14 @@ bool LineEdit::is_virtual_keyboard_enabled() const {
|
|
|
return virtual_keyboard_enabled;
|
|
|
}
|
|
|
|
|
|
+void LineEdit::set_virtual_keyboard_show_on_focus(bool p_show_on_focus) {
|
|
|
+ virtual_keyboard_show_on_focus = p_show_on_focus;
|
|
|
+}
|
|
|
+
|
|
|
+bool LineEdit::get_virtual_keyboard_show_on_focus() const {
|
|
|
+ return virtual_keyboard_show_on_focus;
|
|
|
+}
|
|
|
+
|
|
|
void LineEdit::set_virtual_keyboard_type(VirtualKeyboardType p_type) {
|
|
|
virtual_keyboard_type = p_type;
|
|
|
}
|
|
@@ -3160,6 +3174,8 @@ void LineEdit::_bind_methods() {
|
|
|
ClassDB::bind_method(D_METHOD("is_backspace_deletes_composite_character_enabled"), &LineEdit::is_backspace_deletes_composite_character_enabled);
|
|
|
ClassDB::bind_method(D_METHOD("set_virtual_keyboard_enabled", "enable"), &LineEdit::set_virtual_keyboard_enabled);
|
|
|
ClassDB::bind_method(D_METHOD("is_virtual_keyboard_enabled"), &LineEdit::is_virtual_keyboard_enabled);
|
|
|
+ ClassDB::bind_method(D_METHOD("set_virtual_keyboard_show_on_focus", "show_on_focus"), &LineEdit::set_virtual_keyboard_show_on_focus);
|
|
|
+ ClassDB::bind_method(D_METHOD("get_virtual_keyboard_show_on_focus"), &LineEdit::get_virtual_keyboard_show_on_focus);
|
|
|
ClassDB::bind_method(D_METHOD("set_virtual_keyboard_type", "type"), &LineEdit::set_virtual_keyboard_type);
|
|
|
ClassDB::bind_method(D_METHOD("get_virtual_keyboard_type"), &LineEdit::get_virtual_keyboard_type);
|
|
|
ClassDB::bind_method(D_METHOD("set_clear_button_enabled", "enable"), &LineEdit::set_clear_button_enabled);
|
|
@@ -3239,6 +3255,7 @@ void LineEdit::_bind_methods() {
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emoji_menu_enabled"), "set_emoji_menu_enabled", "is_emoji_menu_enabled");
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "backspace_deletes_composite_character_enabled"), "set_backspace_deletes_composite_character_enabled", "is_backspace_deletes_composite_character_enabled");
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "virtual_keyboard_enabled"), "set_virtual_keyboard_enabled", "is_virtual_keyboard_enabled");
|
|
|
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "virtual_keyboard_show_on_focus"), "set_virtual_keyboard_show_on_focus", "get_virtual_keyboard_show_on_focus");
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "virtual_keyboard_type", PROPERTY_HINT_ENUM, "Default,Multiline,Number,Decimal,Phone,Email,Password,URL"), "set_virtual_keyboard_type", "get_virtual_keyboard_type");
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "clear_button_enabled"), "set_clear_button_enabled", "is_clear_button_enabled");
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shortcut_keys_enabled"), "set_shortcut_keys_enabled", "is_shortcut_keys_enabled");
|