From d831836b09e20d9664da6a4a93867158125e5851 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 24 Sep 2021 17:11:57 +0200 Subject: [PATCH] Improve appearance of the editor Debugger bottom panel menu - Make the Debugger bottom panel menu more prominent when there are errors or warnings by adjusting the text color. - Add some spacing to the right of the error/warning icon for better visual appearance. --- editor/plugins/script_editor_plugin.cpp | 2 ++ editor/script_editor_debugger.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 8841fc1d8ab..071b5a9ffe5 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -3390,6 +3390,8 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { script_editor = this; 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->connect("breaked", this, "_breaked"); diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 3be24deec00..9850c4a97cc 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -1366,6 +1366,7 @@ void ScriptEditorDebugger::_notification(int p_what) { if (error_count == 0 && warning_count == 0) { errors_tab->set_name(TTR("Errors")); debugger_button->set_text(TTR("Debugger")); + debugger_button->add_color_override("font_color", get_color("font_color", "Editor")); debugger_button->set_icon(Ref()); tabs->set_tab_icon(errors_tab->get_index(), Ref()); } else { @@ -1373,12 +1374,16 @@ void ScriptEditorDebugger::_notification(int p_what) { debugger_button->set_text(TTR("Debugger") + " (" + itos(error_count + warning_count) + ")"); if (error_count >= 1 && warning_count >= 1) { 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")); } else if (error_count >= 1) { 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")); } else { 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")); } }