summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-01-02 14:27:21 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-01-02 14:27:21 -0300
commitd88e192ae49dd8c30cf4f94f4a50e41b7d912c2d (patch)
tree58c57ab41c300030fa95723dd8bf79a7b4996671
parente0bcec4fb8c589a68fbf898458ca87502954f81e (diff)
-fix readonly issues (#1018)
-rw-r--r--scene/gui/text_edit.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 3f2f95bbd9..e152c45e52 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -829,7 +829,7 @@ void TextEdit::_notification(int p_what) {
completion_rect.pos.x=cursor_pos.x-nofs;
}
- completion_rect.size.width=w;
+ completion_rect.size.width=w+2;
completion_rect.size.height=h;
if (completion_options.size()<=maxlines)
scrollw=0;
@@ -1034,6 +1034,8 @@ void TextEdit::_consume_backspace_for_pair_symbol(int prev_line, int prev_column
}
void TextEdit::backspace_at_cursor() {
+ if (readonly)
+ return;
if (cursor.column==0 && cursor.line==0)
return;
@@ -1251,6 +1253,8 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
return;
if (completion_active) {
+ if (readonly)
+ break;
bool valid=true;
if (k.mod.command || k.mod.alt || k.mod.meta)
@@ -1400,6 +1404,9 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
if (selection.active) {
+ if (readonly)
+ break;
+
bool clear=false;
bool unselect=false;
bool dobreak=false;
@@ -1513,6 +1520,9 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
case KEY_ENTER:
case KEY_RETURN: {
+ if (readonly)
+ break;
+
String ins="\n";
//keep indentation