diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-09-24 00:58:14 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-10-27 16:56:15 +0200 |
commit | bb681ef9f24f9eb26f6e84cf4357cbd132dd2e3b (patch) | |
tree | 0af4c5c19fd15bb24366d6878a9fec4c0124bc76 /editor | |
parent | 435d50bf0f6963a7ad404fc005997932a251c6ce (diff) |
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.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/debugger/editor_debugger_node.cpp | 5 | ||||
-rw-r--r-- | editor/plugins/debugger_editor_plugin.cpp | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index 188f5708aa..391839d639 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -265,15 +265,20 @@ void EditorDebuggerNode::_notification(int p_what) { if (error_count == 0 && warning_count == 0) { debugger_button->set_text(TTR("Debugger")); + debugger_button->remove_theme_color_override("font_color"); debugger_button->set_icon(Ref<Texture2D>()); } else { debugger_button->set_text(TTR("Debugger") + " (" + itos(error_count + warning_count) + ")"); if (error_count >= 1 && warning_count >= 1) { debugger_button->set_icon(get_theme_icon(SNAME("ErrorWarning"), SNAME("EditorIcons"))); + // Use error color to represent the highest level of severity reported. + debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor"))); } else if (error_count >= 1) { debugger_button->set_icon(get_theme_icon(SNAME("Error"), SNAME("EditorIcons"))); + debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor"))); } else { debugger_button->set_icon(get_theme_icon(SNAME("Warning"), SNAME("EditorIcons"))); + debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor"))); } } last_error_count = error_count; diff --git a/editor/plugins/debugger_editor_plugin.cpp b/editor/plugins/debugger_editor_plugin.cpp index 1512e1817a..cc916aad8b 100644 --- a/editor/plugins/debugger_editor_plugin.cpp +++ b/editor/plugins/debugger_editor_plugin.cpp @@ -34,6 +34,7 @@ #include "editor/debugger/editor_debugger_node.h" #include "editor/debugger/editor_debugger_server.h" #include "editor/editor_node.h" +#include "editor/editor_scale.h" #include "editor/fileserver/editor_file_server.h" #include "scene/gui/menu_button.h" @@ -52,6 +53,8 @@ DebuggerEditorPlugin::DebuggerEditorPlugin(EditorNode *p_editor, MenuButton *p_d EditorDebuggerNode *debugger = memnew(EditorDebuggerNode); 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_theme_constant_override("hseparation", 6 * EDSCALE); debugger->set_tool_button(db); // Main editor debug menu. |