diff options
| author | Andreas Haas | 2016-09-19 14:17:48 +0200 |
|---|---|---|
| committer | Andreas Haas | 2016-09-19 14:17:48 +0200 |
| commit | 9c71e5a9df7ae5e3a81acd3332d16d5bc4e04556 (patch) | |
| tree | e23b4de5c774540d23b8039d27a6d4353648a4b5 /scene/gui/text_edit.cpp | |
| parent | cef70a5f8b87caa00723cfb600c4ccd83305a322 (diff) | |
| download | godot-9c71e5a9df7ae5e3a81acd3332d16d5bc4e04556.tar.gz godot-9c71e5a9df7ae5e3a81acd3332d16d5bc4e04556.tar.zst godot-9c71e5a9df7ae5e3a81acd3332d16d5bc4e04556.zip | |
Fix ability to cut/paste text in LineEdit/TextEdit in readonly mode.
Fixes #6466
Diffstat (limited to 'scene/gui/text_edit.cpp')
| -rw-r--r-- | scene/gui/text_edit.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 9db0a6639..8a9ed98a5 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -2542,7 +2542,9 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { } break; case KEY_X: { - + if (readonly) { + break; + } if (!k.mod.command || k.mod.shift || k.mod.alt) { scancode_handled=false; break; @@ -2574,7 +2576,9 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { undo(); } break; case KEY_V: { - + if (readonly) { + break; + } if (!k.mod.command || k.mod.shift || k.mod.alt) { scancode_handled=false; break; @@ -4527,18 +4531,22 @@ void TextEdit::menu_option(int p_option) { switch( p_option ) { case MENU_CUT: { - - cut(); + if (!readonly) { + cut(); + } } break; case MENU_COPY: { copy(); } break; case MENU_PASTE: { - - paste(); + if (!readonly) { + paste(); + } } break; case MENU_CLEAR: { - clear(); + if (!readonly) { + clear(); + } } break; case MENU_SELECT_ALL: { select_all(); |
