diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-02-13 12:56:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-13 12:56:59 +0100 |
commit | d2765cd04a507a1211a35a9690a482670a49f5fd (patch) | |
tree | 8f7e0d3ababc23ac7cef09ff460bd9c1dcca18df /editor/code_editor.cpp | |
parent | d6a88bbc3060b9adb1fef980bf79b343c89cc360 (diff) | |
parent | 0137ec34686da6c4f62420c11595deb26d74978c (diff) | |
download | redot-engine-d2765cd04a507a1211a35a9690a482670a49f5fd.tar.gz |
Merge pull request #25814 from allkhor/hide_warning_panel
Hide the warning panel when no warnings presents.
Diffstat (limited to 'editor/code_editor.cpp')
-rw-r--r-- | editor/code_editor.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 1e5a2897a7..bbce2353ee 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1177,7 +1177,12 @@ void CodeTextEditor::_warning_label_gui_input(const Ref<InputEvent> &p_event) { } void CodeTextEditor::_warning_button_pressed() { - emit_signal("warning_pressed"); + _set_show_warnings_panel(!is_warnings_panel_opened); +} + +void CodeTextEditor::_set_show_warnings_panel(bool p_show) { + is_warnings_panel_opened = p_show; + emit_signal("show_warnings_panel", p_show); } void CodeTextEditor::_error_pressed(const Ref<InputEvent> &p_event) { @@ -1210,6 +1215,8 @@ void CodeTextEditor::set_warning_nb(int p_warning_nb) { warning_count_label->set_text(itos(p_warning_nb)); warning_count_label->set_visible(p_warning_nb > 0); warning_button->set_visible(p_warning_nb > 0); + if (!p_warning_nb) + _set_show_warnings_panel(false); } void CodeTextEditor::_bind_methods() { @@ -1228,7 +1235,7 @@ void CodeTextEditor::_bind_methods() { ADD_SIGNAL(MethodInfo("validate_script")); ADD_SIGNAL(MethodInfo("load_theme_settings")); - ADD_SIGNAL(MethodInfo("warning_pressed")); + ADD_SIGNAL(MethodInfo("show_warnings_panel")); ADD_SIGNAL(MethodInfo("error_pressed")); } @@ -1313,6 +1320,7 @@ CodeTextEditor::CodeTextEditor() { warning_count_label->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("status_source", "EditorFonts")); warning_count_label->connect("gui_input", this, "_warning_label_gui_input"); + is_warnings_panel_opened = false; set_warning_nb(0); // Line and column |