summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorIbrahn Sahir <ibrahn.sahir@gmail.com>2019-05-21 21:50:02 +0100
committerIbrahn Sahir <ibrahn.sahir@gmail.com>2019-05-21 21:50:02 +0100
commitd8a5fcd3d1a1503c744499cabcf85856a63b3d19 (patch)
tree02153a215d20d67183f881d2005746a86d4dcb9b /scene/gui
parente2375f487c2b6857ba7300ed1d460f43cef8cc59 (diff)
Initialize readonly/editable in LineEdit and TextEdit controls
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/line_edit.cpp1
-rw-r--r--scene/gui/text_edit.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 2d18a80833..ed74851755 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -1656,6 +1656,7 @@ LineEdit::LineEdit() {
context_menu_enabled = true;
menu = memnew(PopupMenu);
add_child(menu);
+ editable = false; // initialise to opposite first, so we get past the early-out in set_editable
set_editable(true);
menu->connect("id_pressed", this, "menu_option");
expand_to_text_length = false;
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 1a000d8da5..380b670368 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -6661,6 +6661,7 @@ TextEdit::TextEdit() {
context_menu_enabled = true;
menu = memnew(PopupMenu);
add_child(menu);
+ readonly = true; // initialise to opposite first, so we get past the early-out in set_readonly
set_readonly(false);
menu->connect("id_pressed", this, "menu_option");
first_draw = true;