1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +00:00

Allow theming renderer colors

This commit is contained in:
passivestar
2024-06-16 19:04:36 +04:00
parent 71699e08c9
commit e0ab91a193

View File

@@ -543,6 +543,8 @@ void EditorNode::_update_theme(bool p_skip_creation) {
tb->set_icon(theme->get_icon(p_editor->get_name(), EditorStringName(EditorIcons))); tb->set_icon(theme->get_icon(p_editor->get_name(), EditorStringName(EditorIcons)));
} }
} }
_update_renderer_color();
} }
editor_dock_manager->update_tab_styles(); editor_dock_manager->update_tab_styles();
@@ -6177,15 +6179,12 @@ Vector<Ref<EditorResourceConversionPlugin>> EditorNode::find_resource_conversion
void EditorNode::_update_renderer_color() { void EditorNode::_update_renderer_color() {
String rendering_method = renderer->get_selected_metadata(); String rendering_method = renderer->get_selected_metadata();
// TODO: Use theme colors instead of hardcoded values.
if (rendering_method == "forward_plus") { if (rendering_method == "forward_plus") {
renderer->add_theme_color_override("font_color", Color::hex(0x5d8c3fff)); renderer->add_theme_color_override("font_color", theme->get_color(SNAME("forward_plus_color"), EditorStringName(Editor)));
} } else if (rendering_method == "mobile") {
if (rendering_method == "mobile") { renderer->add_theme_color_override("font_color", theme->get_color(SNAME("mobile_color"), EditorStringName(Editor)));
renderer->add_theme_color_override("font_color", Color::hex(0xa5557dff)); } else if (rendering_method == "gl_compatibility") {
} renderer->add_theme_color_override("font_color", theme->get_color(SNAME("gl_compatibility_color"), EditorStringName(Editor)));
if (rendering_method == "gl_compatibility") {
renderer->add_theme_color_override("font_color", Color::hex(0x5586a4ff));
} }
} }