summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorYuri Roubinski <chaosus89@gmail.com>2019-08-25 09:57:59 +0300
committerYuri Roubinski <chaosus89@gmail.com>2019-08-25 09:57:59 +0300
commit4efa1b6906789d786e2a356dc572348347cc02db (patch)
tree15b59288f4c06f8a30265fbb4fe0e63a8e8b5aeb /scene/gui
parenta7aacfef7f0753034d6ac468dba4574f8d04d357 (diff)
Disallow undo/redo in readonly TextEdit's
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/text_edit.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index f8c31121be..1f493e3913 100644
--- a/scene/gui/text_edit.cpp
+++ b/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;