summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scene/gui/line_edit.cpp14
-rw-r--r--scene/gui/text_edit.cpp22
2 files changed, 24 insertions, 12 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 90a8af9238..9e58199f35 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -1191,24 +1191,28 @@ void LineEdit::menu_option(int p_option) {
switch(p_option) {
case MENU_CUT: {
- cut_text();
+ if (editable) {
+ cut_text();
+ }
} break;
case MENU_COPY: {
copy_text();
} break;
case MENU_PASTE: {
-
- paste_text();
+ if (editable) {
+ paste_text();
+ }
} break;
case MENU_CLEAR: {
- clear();
+ if (editable) {
+ clear();
+ }
} break;
case MENU_SELECT_ALL: {
select_all();
} break;
case MENU_UNDO: {
-
undo();
} break;
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 9db0a66395..8a9ed98a5f 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();