From d8a5fcd3d1a1503c744499cabcf85856a63b3d19 Mon Sep 17 00:00:00 2001 From: Ibrahn Sahir Date: Tue, 21 May 2019 21:50:02 +0100 Subject: Initialize readonly/editable in LineEdit and TextEdit controls --- scene/gui/line_edit.cpp | 1 + scene/gui/text_edit.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'scene') 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; -- cgit v1.2.3