Add EditorStringNames singleton
This commit is contained in:
parent
fa3428ff25
commit
6de34fde27
176 changed files with 2549 additions and 2325 deletions
|
|
@ -46,7 +46,7 @@ void EditorDirDialog::_update_dir(TreeItem *p_item, EditorFileSystemDirectory *p
|
|||
String path = p_dir->get_path();
|
||||
|
||||
p_item->set_metadata(0, p_dir->get_path());
|
||||
p_item->set_icon(0, tree->get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
p_item->set_icon(0, tree->get_editor_theme_icon(SNAME("Folder")));
|
||||
p_item->set_icon_modulate(0, tree->get_theme_color(SNAME("folder_icon_color"), SNAME("FileDialog")));
|
||||
|
||||
if (!p_item->get_parent()) {
|
||||
|
|
|
|||
|
|
@ -75,37 +75,37 @@ VBoxContainer *EditorFileDialog::get_vbox() {
|
|||
void EditorFileDialog::_update_theme_item_cache() {
|
||||
ConfirmationDialog::_update_theme_item_cache();
|
||||
|
||||
theme_cache.parent_folder = get_theme_icon(SNAME("ArrowUp"), SNAME("EditorIcons"));
|
||||
theme_cache.forward_folder = get_theme_icon(SNAME("Forward"), SNAME("EditorIcons"));
|
||||
theme_cache.back_folder = get_theme_icon(SNAME("Back"), SNAME("EditorIcons"));
|
||||
theme_cache.reload = get_theme_icon(SNAME("Reload"), SNAME("EditorIcons"));
|
||||
theme_cache.toggle_hidden = get_theme_icon(SNAME("GuiVisibilityVisible"), SNAME("EditorIcons"));
|
||||
theme_cache.favorite = get_theme_icon(SNAME("Favorites"), SNAME("EditorIcons"));
|
||||
theme_cache.mode_thumbnails = get_theme_icon(SNAME("FileThumbnail"), SNAME("EditorIcons"));
|
||||
theme_cache.mode_list = get_theme_icon(SNAME("FileList"), SNAME("EditorIcons"));
|
||||
theme_cache.favorites_up = get_theme_icon(SNAME("MoveUp"), SNAME("EditorIcons"));
|
||||
theme_cache.favorites_down = get_theme_icon(SNAME("MoveDown"), SNAME("EditorIcons"));
|
||||
theme_cache.parent_folder = get_editor_theme_icon(SNAME("ArrowUp"));
|
||||
theme_cache.forward_folder = get_editor_theme_icon(SNAME("Forward"));
|
||||
theme_cache.back_folder = get_editor_theme_icon(SNAME("Back"));
|
||||
theme_cache.reload = get_editor_theme_icon(SNAME("Reload"));
|
||||
theme_cache.toggle_hidden = get_editor_theme_icon(SNAME("GuiVisibilityVisible"));
|
||||
theme_cache.favorite = get_editor_theme_icon(SNAME("Favorites"));
|
||||
theme_cache.mode_thumbnails = get_editor_theme_icon(SNAME("FileThumbnail"));
|
||||
theme_cache.mode_list = get_editor_theme_icon(SNAME("FileList"));
|
||||
theme_cache.favorites_up = get_editor_theme_icon(SNAME("MoveUp"));
|
||||
theme_cache.favorites_down = get_editor_theme_icon(SNAME("MoveDown"));
|
||||
|
||||
theme_cache.folder = get_theme_icon(SNAME("Folder"), SNAME("EditorIcons"));
|
||||
theme_cache.folder = get_editor_theme_icon(SNAME("Folder"));
|
||||
theme_cache.folder_icon_color = get_theme_color(SNAME("folder_icon_color"), SNAME("FileDialog"));
|
||||
|
||||
theme_cache.action_copy = get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons"));
|
||||
theme_cache.action_delete = get_theme_icon(SNAME("Remove"), SNAME("EditorIcons"));
|
||||
theme_cache.filesystem = get_theme_icon(SNAME("Filesystem"), SNAME("EditorIcons"));
|
||||
theme_cache.action_copy = get_editor_theme_icon(SNAME("ActionCopy"));
|
||||
theme_cache.action_delete = get_editor_theme_icon(SNAME("Remove"));
|
||||
theme_cache.filesystem = get_editor_theme_icon(SNAME("Filesystem"));
|
||||
|
||||
theme_cache.folder_medium_thumbnail = get_theme_icon(SNAME("FolderMediumThumb"), SNAME("EditorIcons"));
|
||||
theme_cache.file_medium_thumbnail = get_theme_icon(SNAME("FileMediumThumb"), SNAME("EditorIcons"));
|
||||
theme_cache.folder_big_thumbnail = get_theme_icon(SNAME("FolderBigThumb"), SNAME("EditorIcons"));
|
||||
theme_cache.file_big_thumbnail = get_theme_icon(SNAME("FileBigThumb"), SNAME("EditorIcons"));
|
||||
theme_cache.folder_medium_thumbnail = get_editor_theme_icon(SNAME("FolderMediumThumb"));
|
||||
theme_cache.file_medium_thumbnail = get_editor_theme_icon(SNAME("FileMediumThumb"));
|
||||
theme_cache.folder_big_thumbnail = get_editor_theme_icon(SNAME("FolderBigThumb"));
|
||||
theme_cache.file_big_thumbnail = get_editor_theme_icon(SNAME("FileBigThumb"));
|
||||
|
||||
theme_cache.progress[0] = get_theme_icon("Progress1", SNAME("EditorIcons"));
|
||||
theme_cache.progress[1] = get_theme_icon("Progress2", SNAME("EditorIcons"));
|
||||
theme_cache.progress[2] = get_theme_icon("Progress3", SNAME("EditorIcons"));
|
||||
theme_cache.progress[3] = get_theme_icon("Progress4", SNAME("EditorIcons"));
|
||||
theme_cache.progress[4] = get_theme_icon("Progress5", SNAME("EditorIcons"));
|
||||
theme_cache.progress[5] = get_theme_icon("Progress6", SNAME("EditorIcons"));
|
||||
theme_cache.progress[6] = get_theme_icon("Progress7", SNAME("EditorIcons"));
|
||||
theme_cache.progress[7] = get_theme_icon("Progress8", SNAME("EditorIcons"));
|
||||
theme_cache.progress[0] = get_editor_theme_icon("Progress1");
|
||||
theme_cache.progress[1] = get_editor_theme_icon("Progress2");
|
||||
theme_cache.progress[2] = get_editor_theme_icon("Progress3");
|
||||
theme_cache.progress[3] = get_editor_theme_icon("Progress4");
|
||||
theme_cache.progress[4] = get_editor_theme_icon("Progress5");
|
||||
theme_cache.progress[5] = get_editor_theme_icon("Progress6");
|
||||
theme_cache.progress[6] = get_editor_theme_icon("Progress7");
|
||||
theme_cache.progress[7] = get_editor_theme_icon("Progress8");
|
||||
}
|
||||
|
||||
void EditorFileDialog::_notification(int p_what) {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "editor/editor_data.h"
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_scale.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "editor/multi_node_edit.h"
|
||||
|
||||
Size2 EditorObjectSelector::get_minimum_size() const {
|
||||
|
|
@ -200,10 +201,10 @@ void EditorObjectSelector::_notification(int p_what) {
|
|||
case NOTIFICATION_THEME_CHANGED: {
|
||||
update_path();
|
||||
|
||||
int icon_size = get_theme_constant(SNAME("class_icon_size"), SNAME("Editor"));
|
||||
int icon_size = get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor));
|
||||
|
||||
current_object_icon->set_custom_minimum_size(Size2(icon_size, icon_size));
|
||||
current_object_label->add_theme_font_override("font", get_theme_font(SNAME("main"), SNAME("EditorFonts")));
|
||||
current_object_label->add_theme_font_override("font", get_theme_font(SNAME("main"), EditorStringName(EditorFonts)));
|
||||
sub_objects_icon->set_texture(get_theme_icon(SNAME("arrow"), SNAME("OptionButton")));
|
||||
sub_objects_menu->add_theme_constant_override("icon_max_width", icon_size);
|
||||
} break;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
#include "editor/editor_quick_open.h"
|
||||
#include "editor/editor_run_native.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "scene/gui/box_container.h"
|
||||
#include "scene/gui/button.h"
|
||||
#include "scene/gui/panel_container.h"
|
||||
|
|
@ -51,18 +52,18 @@ void EditorRunBar::_notification(int p_what) {
|
|||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_update_play_buttons();
|
||||
pause_button->set_icon(get_theme_icon(SNAME("Pause"), SNAME("EditorIcons")));
|
||||
stop_button->set_icon(get_theme_icon(SNAME("Stop"), SNAME("EditorIcons")));
|
||||
pause_button->set_icon(get_editor_theme_icon(SNAME("Pause")));
|
||||
stop_button->set_icon(get_editor_theme_icon(SNAME("Stop")));
|
||||
|
||||
if (is_movie_maker_enabled()) {
|
||||
main_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("LaunchPadMovieMode"), SNAME("EditorStyles")));
|
||||
write_movie_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("MovieWriterButtonPressed"), SNAME("EditorStyles")));
|
||||
main_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("LaunchPadMovieMode"), EditorStringName(EditorStyles)));
|
||||
write_movie_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("MovieWriterButtonPressed"), EditorStringName(EditorStyles)));
|
||||
} else {
|
||||
main_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("LaunchPadNormal"), SNAME("EditorStyles")));
|
||||
write_movie_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("MovieWriterButtonNormal"), SNAME("EditorStyles")));
|
||||
main_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("LaunchPadNormal"), EditorStringName(EditorStyles)));
|
||||
write_movie_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("MovieWriterButtonNormal"), EditorStringName(EditorStyles)));
|
||||
}
|
||||
|
||||
write_movie_button->set_icon(get_theme_icon(SNAME("MainMovieWrite"), SNAME("EditorIcons")));
|
||||
write_movie_button->set_icon(get_editor_theme_icon(SNAME("MainMovieWrite")));
|
||||
// This button behaves differently, so color it as such.
|
||||
write_movie_button->add_theme_color_override("icon_normal_color", Color(1, 1, 1, 0.7));
|
||||
write_movie_button->add_theme_color_override("icon_pressed_color", Color(0, 0, 0, 0.84));
|
||||
|
|
@ -73,15 +74,15 @@ void EditorRunBar::_notification(int p_what) {
|
|||
|
||||
void EditorRunBar::_reset_play_buttons() {
|
||||
play_button->set_pressed(false);
|
||||
play_button->set_icon(get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons")));
|
||||
play_button->set_icon(get_editor_theme_icon(SNAME("MainPlay")));
|
||||
play_button->set_tooltip_text(TTR("Play the project."));
|
||||
|
||||
play_scene_button->set_pressed(false);
|
||||
play_scene_button->set_icon(get_theme_icon(SNAME("PlayScene"), SNAME("EditorIcons")));
|
||||
play_scene_button->set_icon(get_editor_theme_icon(SNAME("PlayScene")));
|
||||
play_scene_button->set_tooltip_text(TTR("Play the edited scene."));
|
||||
|
||||
play_custom_scene_button->set_pressed(false);
|
||||
play_custom_scene_button->set_icon(get_theme_icon(SNAME("PlayCustom"), SNAME("EditorIcons")));
|
||||
play_custom_scene_button->set_icon(get_editor_theme_icon(SNAME("PlayCustom")));
|
||||
play_custom_scene_button->set_tooltip_text(TTR("Play a custom scene."));
|
||||
}
|
||||
|
||||
|
|
@ -102,18 +103,18 @@ void EditorRunBar::_update_play_buttons() {
|
|||
|
||||
if (active_button) {
|
||||
active_button->set_pressed(true);
|
||||
active_button->set_icon(get_theme_icon(SNAME("Reload"), SNAME("EditorIcons")));
|
||||
active_button->set_icon(get_editor_theme_icon(SNAME("Reload")));
|
||||
active_button->set_tooltip_text(TTR("Reload the played scene."));
|
||||
}
|
||||
}
|
||||
|
||||
void EditorRunBar::_write_movie_toggled(bool p_enabled) {
|
||||
if (p_enabled) {
|
||||
add_theme_style_override("panel", get_theme_stylebox(SNAME("LaunchPadMovieMode"), SNAME("EditorStyles")));
|
||||
write_movie_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("MovieWriterButtonPressed"), SNAME("EditorStyles")));
|
||||
add_theme_style_override("panel", get_theme_stylebox(SNAME("LaunchPadMovieMode"), EditorStringName(EditorStyles)));
|
||||
write_movie_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("MovieWriterButtonPressed"), EditorStringName(EditorStyles)));
|
||||
} else {
|
||||
add_theme_style_override("panel", get_theme_stylebox(SNAME("LaunchPadNormal"), SNAME("EditorStyles")));
|
||||
write_movie_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("MovieWriterButtonNormal"), SNAME("EditorStyles")));
|
||||
add_theme_style_override("panel", get_theme_stylebox(SNAME("LaunchPadNormal"), EditorStringName(EditorStyles)));
|
||||
write_movie_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("MovieWriterButtonNormal"), EditorStringName(EditorStyles)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "editor/editor_resource_preview.h"
|
||||
#include "editor/editor_scale.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "editor/editor_undo_redo_manager.h"
|
||||
#include "editor/inspector_dock.h"
|
||||
#include "scene/gui/box_container.h"
|
||||
|
|
@ -50,9 +51,9 @@ void EditorSceneTabs::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
tabbar_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("tabbar_background"), SNAME("TabContainer")));
|
||||
scene_tabs->add_theme_constant_override("icon_max_width", get_theme_constant(SNAME("class_icon_size"), SNAME("Editor")));
|
||||
scene_tabs->add_theme_constant_override("icon_max_width", get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor)));
|
||||
|
||||
scene_tab_add->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
scene_tab_add->set_icon(get_editor_theme_icon(SNAME("Add")));
|
||||
scene_tab_add->add_theme_color_override("icon_normal_color", Color(0.6f, 0.6f, 0.6f, 0.8f));
|
||||
|
||||
scene_tab_add_ph->set_custom_minimum_size(scene_tab_add->get_minimum_size());
|
||||
|
|
@ -213,7 +214,7 @@ void EditorSceneTabs::update_scene_tabs() {
|
|||
scene_tabs->disconnect("tab_changed", callable_mp(this, &EditorSceneTabs::_scene_tab_changed));
|
||||
|
||||
scene_tabs->clear_tabs();
|
||||
Ref<Texture2D> script_icon = get_theme_icon(SNAME("Script"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> script_icon = get_editor_theme_icon(SNAME("Script"));
|
||||
for (int i = 0; i < EditorNode::get_editor_data().get_edited_scene_count(); i++) {
|
||||
Node *type_node = EditorNode::get_editor_data().get_edited_scene_root(i);
|
||||
Ref<Texture2D> icon;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "editor/editor_scale.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "scene/gui/button.h"
|
||||
#include "scene/gui/label.h"
|
||||
#include "scene/gui/panel_container.h"
|
||||
|
|
@ -110,29 +111,29 @@ void EditorToaster::_notification(int p_what) {
|
|||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
if (vbox_container->is_visible()) {
|
||||
main_button->set_icon(get_theme_icon(SNAME("Notification"), SNAME("EditorIcons")));
|
||||
main_button->set_icon(get_editor_theme_icon(SNAME("Notification")));
|
||||
} else {
|
||||
main_button->set_icon(get_theme_icon(SNAME("NotificationDisabled"), SNAME("EditorIcons")));
|
||||
main_button->set_icon(get_editor_theme_icon(SNAME("NotificationDisabled")));
|
||||
}
|
||||
disable_notifications_button->set_icon(get_theme_icon(SNAME("NotificationDisabled"), SNAME("EditorIcons")));
|
||||
disable_notifications_button->set_icon(get_editor_theme_icon(SNAME("NotificationDisabled")));
|
||||
|
||||
// Styleboxes background.
|
||||
info_panel_style_background->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor")));
|
||||
info_panel_style_background->set_bg_color(get_theme_color(SNAME("base_color"), EditorStringName(Editor)));
|
||||
|
||||
warning_panel_style_background->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor")));
|
||||
warning_panel_style_background->set_border_color(get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
warning_panel_style_background->set_bg_color(get_theme_color(SNAME("base_color"), EditorStringName(Editor)));
|
||||
warning_panel_style_background->set_border_color(get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
|
||||
|
||||
error_panel_style_background->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor")));
|
||||
error_panel_style_background->set_border_color(get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
error_panel_style_background->set_bg_color(get_theme_color(SNAME("base_color"), EditorStringName(Editor)));
|
||||
error_panel_style_background->set_border_color(get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
|
||||
|
||||
// Styleboxes progress.
|
||||
info_panel_style_progress->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor")).lightened(0.03));
|
||||
info_panel_style_progress->set_bg_color(get_theme_color(SNAME("base_color"), EditorStringName(Editor)).lightened(0.03));
|
||||
|
||||
warning_panel_style_progress->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor")).lightened(0.03));
|
||||
warning_panel_style_progress->set_border_color(get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
warning_panel_style_progress->set_bg_color(get_theme_color(SNAME("base_color"), EditorStringName(Editor)).lightened(0.03));
|
||||
warning_panel_style_progress->set_border_color(get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
|
||||
|
||||
error_panel_style_progress->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor")).lightened(0.03));
|
||||
error_panel_style_progress->set_border_color(get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
error_panel_style_progress->set_bg_color(get_theme_color(SNAME("base_color"), EditorStringName(Editor)).lightened(0.03));
|
||||
error_panel_style_progress->set_border_color(get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
|
||||
|
||||
main_button->queue_redraw();
|
||||
disable_notifications_button->queue_redraw();
|
||||
|
|
@ -270,13 +271,13 @@ void EditorToaster::_draw_button() {
|
|||
real_t button_radius = main_button->get_size().x / 8;
|
||||
switch (highest_severity) {
|
||||
case SEVERITY_INFO:
|
||||
color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
color = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
|
||||
break;
|
||||
case SEVERITY_WARNING:
|
||||
color = get_theme_color(SNAME("warning_color"), SNAME("Editor"));
|
||||
color = get_theme_color(SNAME("warning_color"), EditorStringName(Editor));
|
||||
break;
|
||||
case SEVERITY_ERROR:
|
||||
color = get_theme_color(SNAME("error_color"), SNAME("Editor"));
|
||||
color = get_theme_color(SNAME("error_color"), EditorStringName(Editor));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -310,9 +311,9 @@ void EditorToaster::_draw_progress(Control *panel) {
|
|||
void EditorToaster::_set_notifications_enabled(bool p_enabled) {
|
||||
vbox_container->set_visible(p_enabled);
|
||||
if (p_enabled) {
|
||||
main_button->set_icon(get_theme_icon(SNAME("Notification"), SNAME("EditorIcons")));
|
||||
main_button->set_icon(get_editor_theme_icon(SNAME("Notification")));
|
||||
} else {
|
||||
main_button->set_icon(get_theme_icon(SNAME("NotificationDisabled"), SNAME("EditorIcons")));
|
||||
main_button->set_icon(get_editor_theme_icon(SNAME("NotificationDisabled")));
|
||||
}
|
||||
_update_disable_notifications_button();
|
||||
}
|
||||
|
|
@ -374,7 +375,7 @@ Control *EditorToaster::popup(Control *p_control, Severity p_severity, double p_
|
|||
if (p_time > 0.0) {
|
||||
Button *close_button = memnew(Button);
|
||||
close_button->set_flat(true);
|
||||
close_button->set_icon(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
|
||||
close_button->set_icon(get_editor_theme_icon(SNAME("Close")));
|
||||
close_button->connect("pressed", callable_mp(this, &EditorToaster::close).bind(panel));
|
||||
close_button->connect("theme_changed", callable_mp(this, &EditorToaster::_close_button_theme_changed).bind(close_button));
|
||||
hbox_container->add_child(close_button);
|
||||
|
|
@ -490,7 +491,7 @@ void EditorToaster::close(Control *p_control) {
|
|||
void EditorToaster::_close_button_theme_changed(Control *p_close_button) {
|
||||
Button *close_button = Object::cast_to<Button>(p_close_button);
|
||||
if (close_button) {
|
||||
close_button->set_icon(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
|
||||
close_button->set_icon(get_editor_theme_icon(SNAME("Close")));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "editor_validation_panel.h"
|
||||
|
||||
#include "editor/editor_scale.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "scene/gui/box_container.h"
|
||||
#include "scene/gui/button.h"
|
||||
#include "scene/gui/label.h"
|
||||
|
|
@ -52,9 +53,9 @@ void EditorValidationPanel::_update() {
|
|||
void EditorValidationPanel::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
theme_cache.valid_color = get_theme_color(SNAME("success_color"), SNAME("Editor"));
|
||||
theme_cache.warning_color = get_theme_color(SNAME("warning_color"), SNAME("Editor"));
|
||||
theme_cache.error_color = get_theme_color(SNAME("error_color"), SNAME("Editor"));
|
||||
theme_cache.valid_color = get_theme_color(SNAME("success_color"), EditorStringName(Editor));
|
||||
theme_cache.warning_color = get_theme_color(SNAME("warning_color"), EditorStringName(Editor));
|
||||
theme_cache.error_color = get_theme_color(SNAME("error_color"), EditorStringName(Editor));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,8 +145,8 @@ void EditorZoomWidget::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
zoom_minus->set_icon(get_theme_icon(SNAME("ZoomLess"), SNAME("EditorIcons")));
|
||||
zoom_plus->set_icon(get_theme_icon(SNAME("ZoomMore"), SNAME("EditorIcons")));
|
||||
zoom_minus->set_icon(get_editor_theme_icon(SNAME("ZoomLess")));
|
||||
zoom_plus->set_icon(get_editor_theme_icon(SNAME("ZoomMore")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_scale.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "editor/editor_undo_redo_manager.h"
|
||||
#include "editor/node_dock.h"
|
||||
#include "editor/plugins/animation_player_editor_plugin.h"
|
||||
|
|
@ -226,19 +227,19 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
|
|||
item->set_metadata(0, p_node->get_path());
|
||||
|
||||
if (connect_to_script_mode) {
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color accent = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
|
||||
|
||||
Ref<Script> scr = p_node->get_script();
|
||||
if (!scr.is_null() && EditorNode::get_singleton()->get_object_custom_type_base(p_node) != scr) {
|
||||
//has script
|
||||
item->add_button(0, get_theme_icon(SNAME("Script"), SNAME("EditorIcons")), BUTTON_SCRIPT);
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Script")), BUTTON_SCRIPT);
|
||||
} else {
|
||||
//has no script (or script is a custom type)
|
||||
_set_item_custom_color(item, get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
|
||||
_set_item_custom_color(item, get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor)));
|
||||
item->set_selectable(0, false);
|
||||
|
||||
if (!scr.is_null()) { // make sure to mark the script if a custom type
|
||||
item->add_button(0, get_theme_icon(SNAME("Script"), SNAME("EditorIcons")), BUTTON_SCRIPT);
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Script")), BUTTON_SCRIPT);
|
||||
item->set_button_disabled(0, item->get_button_count(0) - 1, true);
|
||||
}
|
||||
|
||||
|
|
@ -255,7 +256,7 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
|
|||
}
|
||||
} else if (part_of_subscene) {
|
||||
if (valid_types.size() == 0) {
|
||||
_set_item_custom_color(item, get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
_set_item_custom_color(item, get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
|
||||
}
|
||||
} else if (marked.has(p_node)) {
|
||||
String node_name = p_node->get_name();
|
||||
|
|
@ -264,15 +265,15 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
|
|||
}
|
||||
item->set_text(0, node_name);
|
||||
item->set_selectable(0, marked_selectable);
|
||||
_set_item_custom_color(item, get_theme_color(SNAME("accent_color"), SNAME("Editor")));
|
||||
_set_item_custom_color(item, get_theme_color(SNAME("accent_color"), EditorStringName(Editor)));
|
||||
} else if (!p_node->can_process()) {
|
||||
_set_item_custom_color(item, get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
|
||||
_set_item_custom_color(item, get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor)));
|
||||
} else if (!marked_selectable && !marked_children_selectable) {
|
||||
Node *node = p_node;
|
||||
while (node) {
|
||||
if (marked.has(node)) {
|
||||
item->set_selectable(0, false);
|
||||
_set_item_custom_color(item, get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
_set_item_custom_color(item, get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
|
||||
break;
|
||||
}
|
||||
node = node->get_parent();
|
||||
|
|
@ -305,11 +306,11 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
|
|||
|
||||
String newline = (num_warnings == 1 ? "\n" : "\n\n");
|
||||
|
||||
item->add_button(0, get_theme_icon(warning_icon, SNAME("EditorIcons")), BUTTON_WARNING, false, TTR("Node configuration warning:") + newline + conf_warning);
|
||||
item->add_button(0, get_editor_theme_icon(warning_icon), BUTTON_WARNING, false, TTR("Node configuration warning:") + newline + conf_warning);
|
||||
}
|
||||
|
||||
if (p_node->is_unique_name_in_owner()) {
|
||||
item->add_button(0, get_theme_icon(SNAME("SceneUniqueName"), SNAME("EditorIcons")), BUTTON_UNIQUE, false, vformat(TTR("This node can be accessed from within anywhere in the scene by preceding it with the '%s' prefix in a node path.\nClick to disable this."), UNIQUE_NODE_PREFIX));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("SceneUniqueName")), BUTTON_UNIQUE, false, vformat(TTR("This node can be accessed from within anywhere in the scene by preceding it with the '%s' prefix in a node path.\nClick to disable this."), UNIQUE_NODE_PREFIX));
|
||||
}
|
||||
|
||||
int num_connections = p_node->get_persistent_signal_connection_count();
|
||||
|
|
@ -345,11 +346,11 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
|
|||
Ref<Texture2D> icon_temp;
|
||||
SceneTreeEditorButton signal_temp = BUTTON_SIGNALS;
|
||||
if (num_connections >= 1 && num_groups >= 1) {
|
||||
icon_temp = get_theme_icon(SNAME("SignalsAndGroups"), SNAME("EditorIcons"));
|
||||
icon_temp = get_editor_theme_icon(SNAME("SignalsAndGroups"));
|
||||
} else if (num_connections >= 1) {
|
||||
icon_temp = get_theme_icon(SNAME("Signals"), SNAME("EditorIcons"));
|
||||
icon_temp = get_editor_theme_icon(SNAME("Signals"));
|
||||
} else if (num_groups >= 1) {
|
||||
icon_temp = get_theme_icon(SNAME("Groups"), SNAME("EditorIcons"));
|
||||
icon_temp = get_editor_theme_icon(SNAME("Groups"));
|
||||
signal_temp = BUTTON_GROUPS;
|
||||
}
|
||||
|
||||
|
|
@ -364,10 +365,10 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
|
|||
String tooltip = String(p_node->get_name());
|
||||
|
||||
if (p_node == get_scene_node() && p_node->get_scene_inherited_state().is_valid()) {
|
||||
item->add_button(0, get_theme_icon(SNAME("InstanceOptions"), SNAME("EditorIcons")), BUTTON_SUBSCENE, false, TTR("Open in Editor"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("InstanceOptions")), BUTTON_SUBSCENE, false, TTR("Open in Editor"));
|
||||
tooltip += String("\n" + TTR("Inherits:") + " " + p_node->get_scene_inherited_state()->get_path());
|
||||
} else if (p_node != get_scene_node() && !p_node->get_scene_file_path().is_empty() && can_open_instance) {
|
||||
item->add_button(0, get_theme_icon(SNAME("InstanceOptions"), SNAME("EditorIcons")), BUTTON_SUBSCENE, false, TTR("Open in Editor"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("InstanceOptions")), BUTTON_SUBSCENE, false, TTR("Open in Editor"));
|
||||
tooltip += String("\n" + TTR("Instance:") + " " + p_node->get_scene_file_path());
|
||||
}
|
||||
|
||||
|
|
@ -400,30 +401,30 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
|
|||
// Can't set tooltip after adding button, need to do it before.
|
||||
if (scr->is_tool()) {
|
||||
additional_notes += "\n" + TTR("This script is currently running in the editor.");
|
||||
button_color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
button_color = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
|
||||
}
|
||||
if (EditorNode::get_singleton()->get_object_custom_type_base(p_node) == scr) {
|
||||
additional_notes += "\n" + TTR("This script is a custom type.");
|
||||
button_color.a = 0.5;
|
||||
}
|
||||
item->add_button(0, get_theme_icon(SNAME("Script"), SNAME("EditorIcons")), BUTTON_SCRIPT, false, TTR("Open Script:") + " " + scr->get_path() + additional_notes);
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Script")), BUTTON_SCRIPT, false, TTR("Open Script:") + " " + scr->get_path() + additional_notes);
|
||||
item->set_button_color(0, item->get_button_count(0) - 1, button_color);
|
||||
}
|
||||
|
||||
if (p_node->is_class("CanvasItem")) {
|
||||
if (p_node->has_meta("_edit_lock_")) {
|
||||
item->add_button(0, get_theme_icon(SNAME("Lock"), SNAME("EditorIcons")), BUTTON_LOCK, false, TTR("Node is locked.\nClick to unlock it."));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Lock")), BUTTON_LOCK, false, TTR("Node is locked.\nClick to unlock it."));
|
||||
}
|
||||
|
||||
if (p_node->has_meta("_edit_group_")) {
|
||||
item->add_button(0, get_theme_icon(SNAME("Group"), SNAME("EditorIcons")), BUTTON_GROUP, false, TTR("Children are not selectable.\nClick to make them selectable."));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Group")), BUTTON_GROUP, false, TTR("Children are not selectable.\nClick to make them selectable."));
|
||||
}
|
||||
|
||||
bool v = p_node->call("is_visible");
|
||||
if (v) {
|
||||
item->add_button(0, get_theme_icon(SNAME("GuiVisibilityVisible"), SNAME("EditorIcons")), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("GuiVisibilityVisible")), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
|
||||
} else {
|
||||
item->add_button(0, get_theme_icon(SNAME("GuiVisibilityHidden"), SNAME("EditorIcons")), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("GuiVisibilityHidden")), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
|
||||
}
|
||||
|
||||
if (!p_node->is_connected("visibility_changed", callable_mp(this, &SceneTreeEditor::_node_visibility_changed))) {
|
||||
|
|
@ -434,9 +435,9 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
|
|||
} else if (p_node->is_class("CanvasLayer") || p_node->is_class("Window")) {
|
||||
bool v = p_node->call("is_visible");
|
||||
if (v) {
|
||||
item->add_button(0, get_theme_icon(SNAME("GuiVisibilityVisible"), SNAME("EditorIcons")), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("GuiVisibilityVisible")), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
|
||||
} else {
|
||||
item->add_button(0, get_theme_icon(SNAME("GuiVisibilityHidden"), SNAME("EditorIcons")), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("GuiVisibilityHidden")), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
|
||||
}
|
||||
|
||||
if (!p_node->is_connected("visibility_changed", callable_mp(this, &SceneTreeEditor::_node_visibility_changed))) {
|
||||
|
|
@ -444,18 +445,18 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
|
|||
}
|
||||
} else if (p_node->is_class("Node3D")) {
|
||||
if (p_node->has_meta("_edit_lock_")) {
|
||||
item->add_button(0, get_theme_icon(SNAME("Lock"), SNAME("EditorIcons")), BUTTON_LOCK, false, TTR("Node is locked.\nClick to unlock it."));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Lock")), BUTTON_LOCK, false, TTR("Node is locked.\nClick to unlock it."));
|
||||
}
|
||||
|
||||
if (p_node->has_meta("_edit_group_")) {
|
||||
item->add_button(0, get_theme_icon(SNAME("Group"), SNAME("EditorIcons")), BUTTON_GROUP, false, TTR("Children are not selectable.\nClick to make them selectable."));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Group")), BUTTON_GROUP, false, TTR("Children are not selectable.\nClick to make them selectable."));
|
||||
}
|
||||
|
||||
bool v = p_node->call("is_visible");
|
||||
if (v) {
|
||||
item->add_button(0, get_theme_icon(SNAME("GuiVisibilityVisible"), SNAME("EditorIcons")), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("GuiVisibilityVisible")), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
|
||||
} else {
|
||||
item->add_button(0, get_theme_icon(SNAME("GuiVisibilityHidden"), SNAME("EditorIcons")), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("GuiVisibilityHidden")), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
|
||||
}
|
||||
|
||||
if (!p_node->is_connected("visibility_changed", callable_mp(this, &SceneTreeEditor::_node_visibility_changed))) {
|
||||
|
|
@ -467,7 +468,7 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
|
|||
bool is_pinned = AnimationPlayerEditor::get_singleton()->get_player() == p_node && AnimationPlayerEditor::get_singleton()->is_pinned();
|
||||
|
||||
if (is_pinned) {
|
||||
item->add_button(0, get_theme_icon(SNAME("Pin"), SNAME("EditorIcons")), BUTTON_PIN, false, TTR("AnimationPlayer is pinned.\nClick to unpin."));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Pin")), BUTTON_PIN, false, TTR("AnimationPlayer is pinned.\nClick to unpin."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -500,7 +501,7 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
|
|||
}
|
||||
|
||||
if (!valid) {
|
||||
_set_item_custom_color(item, get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
|
||||
_set_item_custom_color(item, get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor)));
|
||||
item->set_selectable(0, false);
|
||||
}
|
||||
}
|
||||
|
|
@ -530,9 +531,9 @@ void SceneTreeEditor::_node_visibility_changed(Node *p_node) {
|
|||
}
|
||||
|
||||
if (node_visible) {
|
||||
item->set_button(0, idx, get_theme_icon(SNAME("GuiVisibilityVisible"), SNAME("EditorIcons")));
|
||||
item->set_button(0, idx, get_editor_theme_icon(SNAME("GuiVisibilityVisible")));
|
||||
} else {
|
||||
item->set_button(0, idx, get_theme_icon(SNAME("GuiVisibilityHidden"), SNAME("EditorIcons")));
|
||||
item->set_button(0, idx, get_editor_theme_icon(SNAME("GuiVisibilityHidden")));
|
||||
}
|
||||
|
||||
_update_visibility_color(p_node, item);
|
||||
|
|
@ -674,7 +675,7 @@ bool SceneTreeEditor::_update_filter(TreeItem *p_parent, bool p_scroll_to_select
|
|||
}
|
||||
p_parent->set_selectable(0, true);
|
||||
} else if (keep_for_children) {
|
||||
p_parent->set_custom_color(0, get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
|
||||
p_parent->set_custom_color(0, get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor)));
|
||||
p_parent->set_selectable(0, false);
|
||||
p_parent->deselect(0);
|
||||
}
|
||||
|
|
@ -905,7 +906,7 @@ void SceneTreeEditor::_notification(int p_what) {
|
|||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
tree->add_theme_constant_override("icon_max_width", get_theme_constant(SNAME("class_icon_size"), SNAME("Editor")));
|
||||
tree->add_theme_constant_override("icon_max_width", get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor)));
|
||||
|
||||
_update_tree();
|
||||
} break;
|
||||
|
|
@ -1238,7 +1239,7 @@ Variant SceneTreeEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from
|
|||
if (i < list_max) {
|
||||
HBoxContainer *hb = memnew(HBoxContainer);
|
||||
TextureRect *tf = memnew(TextureRect);
|
||||
int icon_size = get_theme_constant(SNAME("class_icon_size"), SNAME("Editor"));
|
||||
int icon_size = get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor));
|
||||
tf->set_custom_minimum_size(Size2(icon_size, icon_size));
|
||||
tf->set_stretch_mode(TextureRect::STRETCH_KEEP_ASPECT_CENTERED);
|
||||
tf->set_expand_mode(TextureRect::EXPAND_IGNORE_SIZE);
|
||||
|
|
@ -1563,9 +1564,9 @@ void SceneTreeDialog::set_valid_types(const Vector<StringName> &p_valid) {
|
|||
}
|
||||
|
||||
void SceneTreeDialog::_update_theme() {
|
||||
filter->set_right_icon(tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
filter->set_right_icon(tree->get_editor_theme_icon(SNAME("Search")));
|
||||
for (TextureRect *trect : valid_type_icons) {
|
||||
trect->set_custom_minimum_size(Vector2(get_theme_constant(SNAME("class_icon_size"), SNAME("Editor")), 0));
|
||||
trect->set_custom_minimum_size(Vector2(get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor)), 0));
|
||||
trect->set_texture(EditorNode::get_singleton()->get_class_icon(trect->get_meta("type")));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue