summaryrefslogtreecommitdiffstats
path: root/scene/gui/line_edit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/line_edit.cpp')
-rw-r--r--scene/gui/line_edit.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 7d34358af2..a6109a3925 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -31,7 +31,6 @@
#include "line_edit.h"
#include "core/input/input_map.h"
-#include "core/object/message_queue.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
#include "core/string/print_string.h"
@@ -270,7 +269,7 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
if (!text_changed_dirty) {
if (is_inside_tree()) {
- MessageQueue::get_singleton()->push_call(this, "_text_changed");
+ callable_mp(this, &LineEdit::_text_changed).call_deferred();
}
text_changed_dirty = true;
}
@@ -714,7 +713,7 @@ void LineEdit::drop_data(const Point2 &p_point, const Variant &p_data) {
select(caret_column_tmp, caret_column);
if (!text_changed_dirty) {
if (is_inside_tree()) {
- MessageQueue::get_singleton()->push_call(this, "_text_changed");
+ callable_mp(this, &LineEdit::_text_changed).call_deferred();
}
text_changed_dirty = true;
}
@@ -1190,7 +1189,7 @@ void LineEdit::paste_text() {
if (!text_changed_dirty) {
if (is_inside_tree() && text.length() != prev_len) {
- MessageQueue::get_singleton()->push_call(this, "_text_changed");
+ callable_mp(this, &LineEdit::_text_changed).call_deferred();
}
text_changed_dirty = true;
}
@@ -1228,9 +1227,10 @@ void LineEdit::undo() {
TextOperation op = undo_stack_pos->get();
text = op.text;
scroll_offset = op.scroll_offset;
- set_caret_column(op.caret_column);
_shape();
+ set_caret_column(op.caret_column);
+
_emit_text_change();
}
@@ -1252,9 +1252,10 @@ void LineEdit::redo() {
TextOperation op = undo_stack_pos->get();
text = op.text;
scroll_offset = op.scroll_offset;
- set_caret_column(op.caret_column);
_shape();
+ set_caret_column(op.caret_column);
+
_emit_text_change();
}
@@ -1504,7 +1505,7 @@ void LineEdit::delete_text(int p_from_column, int p_to_column) {
if (!text_changed_dirty) {
if (is_inside_tree()) {
- MessageQueue::get_singleton()->push_call(this, "_text_changed");
+ callable_mp(this, &LineEdit::_text_changed).call_deferred();
}
text_changed_dirty = true;
}
@@ -2512,8 +2513,6 @@ void LineEdit::_validate_property(PropertyInfo &p_property) const {
}
void LineEdit::_bind_methods() {
- ClassDB::bind_method(D_METHOD("_text_changed"), &LineEdit::_text_changed);
-
ClassDB::bind_method(D_METHOD("set_horizontal_alignment", "alignment"), &LineEdit::set_horizontal_alignment);
ClassDB::bind_method(D_METHOD("get_horizontal_alignment"), &LineEdit::get_horizontal_alignment);