Merge pull request #53013 from Calinou/editor-debugger-bottom-panel-error-warning-highlight-3.x
This commit is contained in:
commit
70b521af79
2 changed files with 7 additions and 0 deletions
|
@ -3411,6 +3411,8 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
|
||||||
script_editor = this;
|
script_editor = this;
|
||||||
|
|
||||||
Button *db = EditorNode::get_singleton()->add_bottom_panel_item(TTR("Debugger"), debugger);
|
Button *db = EditorNode::get_singleton()->add_bottom_panel_item(TTR("Debugger"), debugger);
|
||||||
|
// Add separation for the warning/error icon that is displayed later.
|
||||||
|
db->add_constant_override("hseparation", 6 * EDSCALE);
|
||||||
debugger->set_tool_button(db);
|
debugger->set_tool_button(db);
|
||||||
|
|
||||||
debugger->connect("breaked", this, "_breaked");
|
debugger->connect("breaked", this, "_breaked");
|
||||||
|
|
|
@ -1370,6 +1370,7 @@ void ScriptEditorDebugger::_notification(int p_what) {
|
||||||
if (error_count == 0 && warning_count == 0) {
|
if (error_count == 0 && warning_count == 0) {
|
||||||
errors_tab->set_name(TTR("Errors"));
|
errors_tab->set_name(TTR("Errors"));
|
||||||
debugger_button->set_text(TTR("Debugger"));
|
debugger_button->set_text(TTR("Debugger"));
|
||||||
|
debugger_button->add_color_override("font_color", get_color("font_color", "Editor"));
|
||||||
debugger_button->set_icon(Ref<Texture>());
|
debugger_button->set_icon(Ref<Texture>());
|
||||||
tabs->set_tab_icon(errors_tab->get_index(), Ref<Texture>());
|
tabs->set_tab_icon(errors_tab->get_index(), Ref<Texture>());
|
||||||
} else {
|
} else {
|
||||||
|
@ -1377,12 +1378,16 @@ void ScriptEditorDebugger::_notification(int p_what) {
|
||||||
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 >= 1 && warning_count >= 1) {
|
if (error_count >= 1 && warning_count >= 1) {
|
||||||
debugger_button->set_icon(get_icon("ErrorWarning", "EditorIcons"));
|
debugger_button->set_icon(get_icon("ErrorWarning", "EditorIcons"));
|
||||||
|
// Use error color to represent the highest level of severity reported.
|
||||||
|
debugger_button->add_color_override("font_color", get_color("error_color", "Editor"));
|
||||||
tabs->set_tab_icon(errors_tab->get_index(), get_icon("ErrorWarning", "EditorIcons"));
|
tabs->set_tab_icon(errors_tab->get_index(), get_icon("ErrorWarning", "EditorIcons"));
|
||||||
} else if (error_count >= 1) {
|
} else if (error_count >= 1) {
|
||||||
debugger_button->set_icon(get_icon("Error", "EditorIcons"));
|
debugger_button->set_icon(get_icon("Error", "EditorIcons"));
|
||||||
|
debugger_button->add_color_override("font_color", get_color("error_color", "Editor"));
|
||||||
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 {
|
} else {
|
||||||
debugger_button->set_icon(get_icon("Warning", "EditorIcons"));
|
debugger_button->set_icon(get_icon("Warning", "EditorIcons"));
|
||||||
|
debugger_button->add_color_override("font_color", get_color("warning_color", "Editor"));
|
||||||
tabs->set_tab_icon(errors_tab->get_index(), get_icon("Warning", "EditorIcons"));
|
tabs->set_tab_icon(errors_tab->get_index(), get_icon("Warning", "EditorIcons"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue