Merge pull request #93229 from passivestar/themable-renderer-colors

Allow theming renderer colors
This commit is contained in:
Rémi Verschelde 2024-06-18 14:08:45 +02:00
commit 0fd5aad1cf
No known key found for this signature in database
GPG key ID: C3336907360768E1

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)));
}
}