Allow theming renderer colors

This commit is contained in:
passivestar 2024-06-16 19:04:36 +04:00
parent 71699e08c9
commit e0ab91a193
1 changed files with 7 additions and 8 deletions

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)));
}
}
_update_renderer_color();
}
editor_dock_manager->update_tab_styles();
@ -6177,15 +6179,12 @@ Vector<Ref<EditorResourceConversionPlugin>> EditorNode::find_resource_conversion
void EditorNode::_update_renderer_color() {
String rendering_method = renderer->get_selected_metadata();
// TODO: Use theme colors instead of hardcoded values.
if (rendering_method == "forward_plus") {
renderer->add_theme_color_override("font_color", Color::hex(0x5d8c3fff));
}
if (rendering_method == "mobile") {
renderer->add_theme_color_override("font_color", Color::hex(0xa5557dff));
}
if (rendering_method == "gl_compatibility") {
renderer->add_theme_color_override("font_color", Color::hex(0x5586a4ff));
renderer->add_theme_color_override("font_color", theme->get_color(SNAME("forward_plus_color"), EditorStringName(Editor)));
} else if (rendering_method == "mobile") {
renderer->add_theme_color_override("font_color", theme->get_color(SNAME("mobile_color"), EditorStringName(Editor)));
} else if (rendering_method == "gl_compatibility") {
renderer->add_theme_color_override("font_color", theme->get_color(SNAME("gl_compatibility_color"), EditorStringName(Editor)));
}
}