Explorar el Código

Disallow undo/redo in readonly TextEdit's

Yuri Roubinski hace 6 años
padre
commit
4efa1b6906
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  1. 8 0
      scene/gui/text_edit.cpp

+ 8 - 0
scene/gui/text_edit.cpp

@@ -3506,6 +3506,10 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
 			} break;
 			case KEY_Z: {
 
+				if (readonly) {
+					break;
+				}
+
 				if (!k->get_command()) {
 					scancode_handled = false;
 					break;
@@ -3518,6 +3522,10 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
 			} break;
 			case KEY_Y: {
 
+				if (readonly) {
+					break;
+				}
+
 				if (!k->get_command()) {
 					scancode_handled = false;
 					break;