diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-11 11:31:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-11 11:31:59 +0200 |
commit | 70e39cc9a583cd315cff5ed63bb8ce0d72e99103 (patch) | |
tree | 752787e2aff56fda6328e08c003b1b6fe5262185 | |
parent | 62bf8b4dd63d12db1dc53587795d8e64fba6bf35 (diff) | |
parent | 564f8ccc1311f7f2a76e583d36d9f76347106f16 (diff) |
Merge pull request #38592 from Calinou/debugger-error-warning-icon
Use a different icon for the debugger tab with both warnings and errors
-rw-r--r-- | editor/debugger/editor_debugger_node.cpp | 8 | ||||
-rw-r--r-- | editor/debugger/script_editor_debugger.cpp | 8 | ||||
-rw-r--r-- | editor/icons/ErrorWarning.svg | 1 |
3 files changed, 11 insertions, 6 deletions
diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index 3302b50103..7551214336 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<Texture2D>()); } 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 0fa62253c3..af79de2991 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -131,10 +131,12 @@ void ScriptEditorDebugger::update_tabs() { tabs->set_tab_icon(errors_tab->get_index(), Ref<Texture2D>()); } 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 0000000000..72b5037e50 --- /dev/null +++ b/editor/icons/ErrorWarning.svg @@ -0,0 +1 @@ +<svg height="8" viewBox="0 0 8 8" width="8" xmlns="http://www.w3.org/2000/svg"><path d="m4 0c-2.216 0-4 1.784-4 4s1.784 4 4 4z" fill="#ff5d5d"/><path d="m4 .00000003c2.216 0 4 1.78399997 4 3.99999997s-1.784 4-4 4z" fill="#ffdd65"/></svg>
\ No newline at end of file |