浏览代码

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)
Hugo Locurcio 5 年之前
父节点
当前提交
d7f1a43d1a
共有 2 个文件被更改,包括 8 次插入4 次删除
  1. 1 0
      editor/icons/ErrorWarning.svg
  2. 7 4
      editor/script_editor_debugger.cpp

+ 1 - 0
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>

+ 7 - 4
editor/script_editor_debugger.cpp

@@ -1326,12 +1326,15 @@ void ScriptEditorDebugger::_notification(int p_what) {
 				} else {
 				} else {
 					errors_tab->set_name(TTR("Errors") + " (" + itos(error_count + warning_count) + ")");
 					errors_tab->set_name(TTR("Errors") + " (" + itos(error_count + warning_count) + ")");
 					debugger_button->set_text(TTR("Debugger") + " (" + 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"));
 						debugger_button->set_icon(get_icon("Error", "EditorIcons"));
 						tabs->set_tab_icon(errors_tab->get_index(), 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;
 				last_error_count = error_count;