Просмотр исходного кода

Initialize readonly/editable in LineEdit and TextEdit controls

Ibrahn Sahir 6 лет назад
Родитель
Сommit
d8a5fcd3d1
2 измененных файлов с 2 добавлено и 0 удалено
  1. 1 0
      scene/gui/line_edit.cpp
  2. 1 0
      scene/gui/text_edit.cpp

+ 1 - 0
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;

+ 1 - 0
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;