summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorHakim <hakim.rouatbi@gmail.com>2022-12-23 22:54:09 +0100
committerHakim <hakim.rouatbi@gmail.com>2022-12-24 00:43:18 +0100
commit6a603001933ca5e65654ec0886792e617d4e4567 (patch)
treeef297b57234fd65464fc37b633f0dee84c991fd2 /editor
parentf7cf9fb148140b86ee5795110373a0d55ff32860 (diff)
Bring back the renderer options button on the main editor
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 01e605880c..3281d0a0fa 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -5846,10 +5846,14 @@ void EditorNode::_bottom_panel_raise_toggled(bool p_pressed) {
}
void EditorNode::_update_renderer_color() {
- if (renderer->get_text() == "gl_compatibility") {
+ if (renderer->get_text() == "Forward+") {
+ renderer->add_theme_color_override("font_color", Color::hex(0x5d8c3fff));
+ }
+ if (renderer->get_text() == "Mobile") {
+ renderer->add_theme_color_override("font_color", Color::hex(0xa5557dff));
+ }
+ if (renderer->get_text() == "Compatibility") {
renderer->add_theme_color_override("font_color", Color::hex(0x5586a4ff));
- } else if (renderer->get_text() == "forward_plus" || renderer->get_text() == "mobile") {
- renderer->add_theme_color_override("font_color", theme_base->get_theme_color(SNAME("highend_color"), SNAME("Editor")));
}
}
@@ -6937,14 +6941,14 @@ EditorNode::EditorNode() {
menu_hb->add_child(right_menu_hb);
renderer = memnew(OptionButton);
- // Hide the renderer selection dropdown until OpenGL support is more mature.
- // The renderer can still be changed in the project settings or using `--rendering-driver opengl3`.
- renderer->set_visible(false);
+ renderer->set_visible(true);
renderer->set_flat(true);
+ renderer->set_fit_to_longest_item(false);
renderer->set_focus_mode(Control::FOCUS_NONE);
renderer->connect("item_selected", callable_mp(this, &EditorNode::_renderer_selected));
renderer->add_theme_font_override("font", gui_base->get_theme_font(SNAME("bold"), SNAME("EditorFonts")));
renderer->add_theme_font_size_override("font_size", gui_base->get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts")));
+ renderer->set_tooltip_text(TTR("Choose a renderer."));
right_menu_hb->add_child(renderer);
@@ -6967,7 +6971,15 @@ EditorNode::EditorNode() {
String rendering_method = renderers[i];
// Add the renderers name to the UI.
- renderer->add_item(rendering_method);
+ if (rendering_method == "forward_plus") {
+ renderer->add_item(TTR("Forward+"));
+ }
+ if (rendering_method == "mobile") {
+ renderer->add_item(TTR("Mobile"));
+ }
+ if (rendering_method == "gl_compatibility") {
+ renderer->add_item(TTR("Compatibility"));
+ }
renderer->set_item_metadata(i, rendering_method);
// Lowercase for standard comparison.