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

Add EditorStringNames singleton

This commit is contained in:
kobewi
2023-08-13 02:33:39 +02:00
parent fa3428ff25
commit 6de34fde27
176 changed files with 2549 additions and 2325 deletions

View File

@@ -35,13 +35,14 @@
#include "editor/editor_node.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
#include "editor/editor_string_names.h"
void EditorHelpSearch::_update_icons() {
search_box->set_right_icon(results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
search_box->set_right_icon(results_tree->get_editor_theme_icon(SNAME("Search")));
search_box->set_clear_button_enabled(true);
search_box->add_theme_icon_override("right_icon", results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
case_sensitive_button->set_icon(results_tree->get_theme_icon(SNAME("MatchCase"), SNAME("EditorIcons")));
hierarchy_button->set_icon(results_tree->get_theme_icon(SNAME("ClassList"), SNAME("EditorIcons")));
search_box->add_theme_icon_override("right_icon", results_tree->get_editor_theme_icon(SNAME("Search")));
case_sensitive_button->set_icon(results_tree->get_editor_theme_icon(SNAME("MatchCase")));
hierarchy_button->set_icon(results_tree->get_editor_theme_icon(SNAME("ClassList")));
if (is_visible()) {
_update_results();
@@ -608,10 +609,10 @@ TreeItem *EditorHelpSearch::Runner::_create_class_item(TreeItem *p_parent, const
}
if (p_doc->is_deprecated) {
Ref<Texture2D> error_icon = ui_service->get_theme_icon("StatusError", SNAME("EditorIcons"));
Ref<Texture2D> error_icon = ui_service->get_editor_theme_icon("StatusError");
item->add_button(0, error_icon, 0, false, TTR("This class is marked as deprecated."));
} else if (p_doc->is_experimental) {
Ref<Texture2D> warning_icon = ui_service->get_theme_icon("NodeWarning", SNAME("EditorIcons"));
Ref<Texture2D> warning_icon = ui_service->get_editor_theme_icon("NodeWarning");
item->add_button(0, warning_icon, 0, false, TTR("This class is marked as experimental."));
}
@@ -656,10 +657,10 @@ TreeItem *EditorHelpSearch::Runner::_create_member_item(TreeItem *p_parent, cons
Ref<Texture2D> icon;
String text;
if (search_flags & SEARCH_SHOW_HIERARCHY) {
icon = ui_service->get_theme_icon(p_icon, SNAME("EditorIcons"));
icon = ui_service->get_editor_theme_icon(p_icon);
text = p_text;
} else {
icon = ui_service->get_theme_icon(p_icon, SNAME("EditorIcons"));
icon = ui_service->get_editor_theme_icon(p_icon);
text = p_class_name + "." + p_text;
}
@@ -672,10 +673,10 @@ TreeItem *EditorHelpSearch::Runner::_create_member_item(TreeItem *p_parent, cons
item->set_metadata(0, "class_" + p_metatype + ":" + p_class_name + ":" + p_name);
if (is_deprecated) {
Ref<Texture2D> error_icon = ui_service->get_theme_icon("StatusError", SNAME("EditorIcons"));
Ref<Texture2D> error_icon = ui_service->get_editor_theme_icon("StatusError");
item->add_button(0, error_icon, 0, false, TTR("This member is marked as deprecated."));
} else if (is_experimental) {
Ref<Texture2D> warning_icon = ui_service->get_theme_icon("NodeWarning", SNAME("EditorIcons"));
Ref<Texture2D> warning_icon = ui_service->get_editor_theme_icon("NodeWarning");
item->add_button(0, warning_icon, 0, false, TTR("This member is marked as experimental."));
}
@@ -700,5 +701,5 @@ EditorHelpSearch::Runner::Runner(Control *p_icon_service, Tree *p_results_tree,
results_tree(p_results_tree),
term((p_search_flags & SEARCH_CASE_SENSITIVE) == 0 ? p_term.strip_edges().to_lower() : p_term.strip_edges()),
search_flags(p_search_flags),
disabled_color(ui_service->get_theme_color(SNAME("disabled_font_color"), SNAME("Editor"))) {
disabled_color(ui_service->get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor))) {
}