summaryrefslogtreecommitdiff
path: root/scene/gui/text_edit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r--scene/gui/text_edit.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 5fbc0c9064..87043c65eb 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1498,7 +1498,7 @@ 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);
+ VisualServer::get_singleton()->canvas_item_set_z_index(get_canvas_item(), 1);
}
} break;
@@ -1512,7 +1512,7 @@ void TextEdit::_notification(int p_what) {
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);
+ VisualServer::get_singleton()->canvas_item_set_z_index(get_canvas_item(), 0);
}
} break;
}
@@ -1822,10 +1822,18 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
if (mb->is_pressed()) {
if (mb->get_button_index() == BUTTON_WHEEL_UP && !mb->get_command()) {
- _scroll_up(3 * mb->get_factor());
+ if (mb->get_shift()) {
+ h_scroll->set_value(h_scroll->get_value() - (100 * mb->get_factor()));
+ } else {
+ _scroll_up(3 * mb->get_factor());
+ }
}
if (mb->get_button_index() == BUTTON_WHEEL_DOWN && !mb->get_command()) {
- _scroll_down(3 * mb->get_factor());
+ if (mb->get_shift()) {
+ h_scroll->set_value(h_scroll->get_value() + (100 * mb->get_factor()));
+ } else {
+ _scroll_down(3 * mb->get_factor());
+ }
}
if (mb->get_button_index() == BUTTON_WHEEL_LEFT) {
h_scroll->set_value(h_scroll->get_value() - (100 * mb->get_factor()));
@@ -5054,7 +5062,7 @@ void TextEdit::_confirm_completion() {
void TextEdit::_cancel_code_hint() {
- VisualServer::get_singleton()->canvas_item_set_z(get_canvas_item(), 0);
+ VisualServer::get_singleton()->canvas_item_set_z_index(get_canvas_item(), 0);
raised_from_completion = false;
completion_hint = "";
update();
@@ -5062,7 +5070,7 @@ void TextEdit::_cancel_code_hint() {
void TextEdit::_cancel_completion() {
- VisualServer::get_singleton()->canvas_item_set_z(get_canvas_item(), 0);
+ VisualServer::get_singleton()->canvas_item_set_z_index(get_canvas_item(), 0);
raised_from_completion = false;
if (!completion_active)
return;
@@ -5237,7 +5245,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);
+ VisualServer::get_singleton()->canvas_item_set_z_index(get_canvas_item(), 1);
raised_from_completion = true;
completion_hint = p_hint;
completion_hint_offset = -0xFFFF;
@@ -5246,7 +5254,7 @@ void TextEdit::set_code_hint(const String &p_hint) {
void TextEdit::code_complete(const Vector<String> &p_strings, bool p_forced) {
- VisualServer::get_singleton()->canvas_item_set_z(get_canvas_item(), 1);
+ VisualServer::get_singleton()->canvas_item_set_z_index(get_canvas_item(), 1);
raised_from_completion = true;
completion_strings = p_strings;
completion_active = true;