diff options
author | Chaosus <chaosus89@gmail.com> | 2018-12-21 11:05:29 +0300 |
---|---|---|
committer | Chaosus <chaosus89@gmail.com> | 2018-12-21 11:39:54 +0300 |
commit | 260b5818f1cee46e1332b620bf9aaba821d7a025 (patch) | |
tree | cfeb4630e60de570078e2c535331f1cd3ae53d13 /editor/code_editor.cpp | |
parent | f3cb236f9d0e559e759dabc7cb5b6c1368d45e6e (diff) |
Change LinkLabel back to Label in error status bar
Diffstat (limited to 'editor/code_editor.cpp')
-rw-r--r-- | editor/code_editor.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 05081d2639..46a4dea13f 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1129,8 +1129,11 @@ void CodeTextEditor::set_edit_state(const Variant &p_state) { void CodeTextEditor::set_error(const String &p_error) { error->set_text(p_error); - error->set_tooltip(p_error); - error->set_visible(p_error != ""); + if (p_error != "") { + error->set_default_cursor_shape(CURSOR_POINTING_HAND); + } else { + error->set_default_cursor_shape(CURSOR_ARROW); + } } void CodeTextEditor::set_error_pos(int p_line, int p_column) { @@ -1138,10 +1141,12 @@ void CodeTextEditor::set_error_pos(int p_line, int p_column) { error_column = p_column; } -void CodeTextEditor::_error_pressed() { - text_editor->cursor_set_line(error_line); - text_editor->cursor_set_column(error_column); - text_editor->center_viewport_to_cursor(); +void CodeTextEditor::goto_error() { + if (error->get_text() != "") { + text_editor->cursor_set_line(error_line); + text_editor->cursor_set_column(error_column); + text_editor->center_viewport_to_cursor(); + } } void CodeTextEditor::_update_font() { @@ -1204,7 +1209,6 @@ void CodeTextEditor::_bind_methods() { ClassDB::bind_method("_code_complete_timer_timeout", &CodeTextEditor::_code_complete_timer_timeout); ClassDB::bind_method("_complete_request", &CodeTextEditor::_complete_request); ClassDB::bind_method("_font_resize_timeout", &CodeTextEditor::_font_resize_timeout); - ClassDB::bind_method("_error_pressed", &CodeTextEditor::_error_pressed); ADD_SIGNAL(MethodInfo("validate_script")); ADD_SIGNAL(MethodInfo("load_theme_settings")); @@ -1254,19 +1258,14 @@ CodeTextEditor::CodeTextEditor() { error_line = 0; error_column = 0; - Control *error_box = memnew(Control); - status_bar->add_child(error_box); - error_box->set_v_size_flags(SIZE_EXPAND_FILL); - error_box->set_h_size_flags(SIZE_EXPAND_FILL); - error_box->set_clip_contents(true); - - error = memnew(LinkButton); - error_box->add_child(error); - error->set_anchors_and_margins_preset(Control::PRESET_CENTER_LEFT); - error->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER); + error = memnew(Label); + status_bar->add_child(error); + error->set_autowrap(true); + error->set_valign(Label::VALIGN_CENTER); + error->set_h_size_flags(SIZE_EXPAND_FILL); //required for it to display, given now it's clipping contents, do not touch error->add_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_color("error_color", "Editor")); error->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("status_source", "EditorFonts")); - error->connect("pressed", this, "_error_pressed"); + error->set_mouse_filter(MOUSE_FILTER_STOP); find_replace_bar->connect("error", error, "set_text"); status_bar->add_child(memnew(Label)); //to keep the height if the other labels are not visible |