From 564f8ccc1311f7f2a76e583d36d9f76347106f16 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 9 May 2020 15:29:13 +0200 Subject: [PATCH] Use a different icon for the debugger tab with both warnings and errors This makes it possible to see if both errors and warnings were pushed without having to open the tab. --- editor/debugger/editor_debugger_node.cpp | 8 +++++--- editor/debugger/script_editor_debugger.cpp | 8 +++++--- editor/icons/ErrorWarning.svg | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 editor/icons/ErrorWarning.svg diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index 3302b50103c..75512143364 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -261,10 +261,12 @@ void EditorDebuggerNode::_notification(int p_what) { debugger_button->set_icon(Ref()); } else { debugger_button->set_text(TTR("Debugger") + " (" + itos(error_count + warning_count) + ")"); - if (error_count == 0) { - debugger_button->set_icon(get_theme_icon("Warning", "EditorIcons")); - } else { + if (error_count >= 1 && warning_count >= 1) { + debugger_button->set_icon(get_theme_icon("ErrorWarning", "EditorIcons")); + } else if (error_count >= 1) { debugger_button->set_icon(get_theme_icon("Error", "EditorIcons")); + } else { + debugger_button->set_icon(get_theme_icon("Warning", "EditorIcons")); } } last_error_count = error_count; diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index 152989f90bc..f816e7f0523 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -130,10 +130,12 @@ void ScriptEditorDebugger::update_tabs() { tabs->set_tab_icon(errors_tab->get_index(), Ref()); } else { errors_tab->set_name(TTR("Errors") + " (" + itos(error_count + warning_count) + ")"); - if (error_count == 0) { - tabs->set_tab_icon(errors_tab->get_index(), get_theme_icon("Warning", "EditorIcons")); - } else { + if (error_count >= 1 && warning_count >= 1) { + tabs->set_tab_icon(errors_tab->get_index(), get_theme_icon("ErrorWarning", "EditorIcons")); + } else if (error_count >= 1) { tabs->set_tab_icon(errors_tab->get_index(), get_theme_icon("Error", "EditorIcons")); + } else { + tabs->set_tab_icon(errors_tab->get_index(), get_theme_icon("Warning", "EditorIcons")); } } } diff --git a/editor/icons/ErrorWarning.svg b/editor/icons/ErrorWarning.svg new file mode 100644 index 00000000000..72b5037e50a --- /dev/null +++ b/editor/icons/ErrorWarning.svg @@ -0,0 +1 @@ + \ No newline at end of file