diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2016-10-11 09:10:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-11 09:10:39 +0200 |
commit | 0f587c460e1f9675018cc3b3c07d9b750c522436 (patch) | |
tree | 724268fe849e49965e7fccfeacb1b8709ba0e5cf /scene/gui | |
parent | 53016ef7a134298f789f207c2cb2ab67d73f7946 (diff) | |
parent | f73b501d6f54a458a70d1e123d17d52e79072d04 (diff) |
Merge pull request #6778 from Hinsbart/completion_z
Fix Script Editor drawing over Dialogs.
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/text_edit.cpp | 14 | ||||
-rw-r--r-- | scene/gui/text_edit.h | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index eee3ab462a..a68d3c13a7 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1253,15 +1253,19 @@ void TextEdit::_notification(int p_what) { } if (OS::get_singleton()->has_virtual_keyboard()) OS::get_singleton()->show_virtual_keyboard(get_text(),get_global_rect()); + if (raised_from_completion) { + VisualServer::get_singleton()->canvas_item_set_z(get_canvas_item(), 1); + } } break; case NOTIFICATION_FOCUS_EXIT: { if (OS::get_singleton()->has_virtual_keyboard()) OS::get_singleton()->hide_virtual_keyboard(); - + if (raised_from_completion) { + VisualServer::get_singleton()->canvas_item_set_z(get_canvas_item(), 0); + } } break; - } } @@ -4207,6 +4211,7 @@ void TextEdit::_confirm_completion() { void TextEdit::_cancel_code_hint() { VisualServer::get_singleton()->canvas_item_set_z(get_canvas_item(), 0); + raised_from_completion = false; completion_hint=""; update(); } @@ -4214,6 +4219,7 @@ void TextEdit::_cancel_code_hint() { void TextEdit::_cancel_completion() { VisualServer::get_singleton()->canvas_item_set_z(get_canvas_item(), 0); + raised_from_completion = false; if (!completion_active) return; @@ -4394,6 +4400,7 @@ void TextEdit::query_code_comple() { void TextEdit::set_code_hint(const String& p_hint) { VisualServer::get_singleton()->canvas_item_set_z(get_canvas_item(), 1); + raised_from_completion = true; completion_hint=p_hint; completion_hint_offset=-0xFFFF; update(); @@ -4402,6 +4409,7 @@ void TextEdit::set_code_hint(const String& p_hint) { void TextEdit::code_complete(const Vector<String> &p_strings) { VisualServer::get_singleton()->canvas_item_set_z(get_canvas_item(), 1); + raised_from_completion = true; completion_strings=p_strings; completion_active=true; completion_current=""; @@ -4816,6 +4824,8 @@ TextEdit::TextEdit() { window_has_focus=true; select_identifiers_enabled=false; + raised_from_completion = false; + context_menu_enabled=true; menu = memnew( PopupMenu ); add_child(menu); diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 2a451ff45f..e6401e2b92 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -246,6 +246,8 @@ class TextEdit : public Control { bool insert_mode; bool select_identifiers_enabled; + bool raised_from_completion; + String hilighted_word; uint64_t last_dblclk; |