From d7f1a43d1aef2bb5f6c6427673c4bf3c449ce86b 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. (cherry picked from commit 564f8ccc1311f7f2a76e583d36d9f76347106f16) --- editor/icons/ErrorWarning.svg | 1 + editor/script_editor_debugger.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 editor/icons/ErrorWarning.svg 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 diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 8ff3a2b3d75..5995777558b 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -1326,12 +1326,15 @@ void ScriptEditorDebugger::_notification(int p_what) { } else { errors_tab->set_name(TTR("Errors") + " (" + itos(error_count + warning_count) + ")"); debugger_button->set_text(TTR("Debugger") + " (" + itos(error_count + warning_count) + ")"); - if (error_count == 0) { - debugger_button->set_icon(get_icon("Warning", "EditorIcons")); - tabs->set_tab_icon(errors_tab->get_index(), get_icon("Warning", "EditorIcons")); - } else { + if (error_count >= 1 && warning_count >= 1) { + debugger_button->set_icon(get_icon("ErrorWarning", "EditorIcons")); + tabs->set_tab_icon(errors_tab->get_index(), get_icon("ErrorWarning", "EditorIcons")); + } else if (error_count >= 1) { debugger_button->set_icon(get_icon("Error", "EditorIcons")); tabs->set_tab_icon(errors_tab->get_index(), get_icon("Error", "EditorIcons")); + } else { + debugger_button->set_icon(get_icon("Warning", "EditorIcons")); + tabs->set_tab_icon(errors_tab->get_index(), get_icon("Warning", "EditorIcons")); } } last_error_count = error_count;