mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Add EditorStringNames singleton
This commit is contained in:
parent
fa3428ff25
commit
6de34fde27
176 changed files with 2549 additions and 2325 deletions
|
|
@ -34,6 +34,7 @@
|
|||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_resource_picker.h"
|
||||
#include "editor/editor_scale.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "editor/editor_undo_redo_manager.h"
|
||||
#include "editor/gui/editor_file_dialog.h"
|
||||
#include "editor/progress_dialog.h"
|
||||
|
|
@ -84,7 +85,7 @@ void ThemeItemImportTree::_update_items_tree() {
|
|||
|
||||
Ref<Texture2D> type_icon;
|
||||
if (E == "") {
|
||||
type_icon = get_theme_icon(SNAME("NodeDisabled"), SNAME("EditorIcons"));
|
||||
type_icon = get_editor_theme_icon(SNAME("NodeDisabled"));
|
||||
} else {
|
||||
type_icon = EditorNode::get_singleton()->get_class_icon(E, "NodeDisabled");
|
||||
}
|
||||
|
|
@ -147,7 +148,7 @@ void ThemeItemImportTree::_update_items_tree() {
|
|||
|
||||
switch (dt) {
|
||||
case Theme::DATA_TYPE_COLOR:
|
||||
data_type_node->set_icon(0, get_theme_icon(SNAME("Color"), SNAME("EditorIcons")));
|
||||
data_type_node->set_icon(0, get_editor_theme_icon(SNAME("Color")));
|
||||
data_type_node->set_text(0, TTR("Colors"));
|
||||
|
||||
item_list = &tree_color_items;
|
||||
|
|
@ -155,7 +156,7 @@ void ThemeItemImportTree::_update_items_tree() {
|
|||
break;
|
||||
|
||||
case Theme::DATA_TYPE_CONSTANT:
|
||||
data_type_node->set_icon(0, get_theme_icon(SNAME("MemberConstant"), SNAME("EditorIcons")));
|
||||
data_type_node->set_icon(0, get_editor_theme_icon(SNAME("MemberConstant")));
|
||||
data_type_node->set_text(0, TTR("Constants"));
|
||||
|
||||
item_list = &tree_constant_items;
|
||||
|
|
@ -163,7 +164,7 @@ void ThemeItemImportTree::_update_items_tree() {
|
|||
break;
|
||||
|
||||
case Theme::DATA_TYPE_FONT:
|
||||
data_type_node->set_icon(0, get_theme_icon(SNAME("Font"), SNAME("EditorIcons")));
|
||||
data_type_node->set_icon(0, get_editor_theme_icon(SNAME("Font")));
|
||||
data_type_node->set_text(0, TTR("Fonts"));
|
||||
|
||||
item_list = &tree_font_items;
|
||||
|
|
@ -171,7 +172,7 @@ void ThemeItemImportTree::_update_items_tree() {
|
|||
break;
|
||||
|
||||
case Theme::DATA_TYPE_FONT_SIZE:
|
||||
data_type_node->set_icon(0, get_theme_icon(SNAME("FontSize"), SNAME("EditorIcons")));
|
||||
data_type_node->set_icon(0, get_editor_theme_icon(SNAME("FontSize")));
|
||||
data_type_node->set_text(0, TTR("Font Sizes"));
|
||||
|
||||
item_list = &tree_font_size_items;
|
||||
|
|
@ -179,7 +180,7 @@ void ThemeItemImportTree::_update_items_tree() {
|
|||
break;
|
||||
|
||||
case Theme::DATA_TYPE_ICON:
|
||||
data_type_node->set_icon(0, get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons")));
|
||||
data_type_node->set_icon(0, get_editor_theme_icon(SNAME("ImageTexture")));
|
||||
data_type_node->set_text(0, TTR("Icons"));
|
||||
|
||||
item_list = &tree_icon_items;
|
||||
|
|
@ -187,7 +188,7 @@ void ThemeItemImportTree::_update_items_tree() {
|
|||
break;
|
||||
|
||||
case Theme::DATA_TYPE_STYLEBOX:
|
||||
data_type_node->set_icon(0, get_theme_icon(SNAME("StyleBoxFlat"), SNAME("EditorIcons")));
|
||||
data_type_node->set_icon(0, get_editor_theme_icon(SNAME("StyleBoxFlat")));
|
||||
data_type_node->set_text(0, TTR("Styleboxes"));
|
||||
|
||||
item_list = &tree_stylebox_items;
|
||||
|
|
@ -851,49 +852,49 @@ void ThemeItemImportTree::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
select_icons_warning_icon->set_texture(get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons")));
|
||||
select_icons_warning->add_theme_color_override("font_color", get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
|
||||
select_icons_warning_icon->set_texture(get_editor_theme_icon(SNAME("StatusWarning")));
|
||||
select_icons_warning->add_theme_color_override("font_color", get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor)));
|
||||
|
||||
import_items_filter->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
import_items_filter->set_right_icon(get_editor_theme_icon(SNAME("Search")));
|
||||
|
||||
// Bottom panel buttons.
|
||||
import_collapse_types_button->set_icon(get_theme_icon(SNAME("CollapseTree"), SNAME("EditorIcons")));
|
||||
import_expand_types_button->set_icon(get_theme_icon(SNAME("ExpandTree"), SNAME("EditorIcons")));
|
||||
import_collapse_types_button->set_icon(get_editor_theme_icon(SNAME("CollapseTree")));
|
||||
import_expand_types_button->set_icon(get_editor_theme_icon(SNAME("ExpandTree")));
|
||||
|
||||
import_select_all_button->set_icon(get_theme_icon(SNAME("ThemeSelectAll"), SNAME("EditorIcons")));
|
||||
import_select_full_button->set_icon(get_theme_icon(SNAME("ThemeSelectFull"), SNAME("EditorIcons")));
|
||||
import_deselect_all_button->set_icon(get_theme_icon(SNAME("ThemeDeselectAll"), SNAME("EditorIcons")));
|
||||
import_select_all_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectAll")));
|
||||
import_select_full_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectFull")));
|
||||
import_deselect_all_button->set_icon(get_editor_theme_icon(SNAME("ThemeDeselectAll")));
|
||||
|
||||
// Side panel buttons.
|
||||
select_colors_icon->set_texture(get_theme_icon(SNAME("Color"), SNAME("EditorIcons")));
|
||||
deselect_all_colors_button->set_icon(get_theme_icon(SNAME("ThemeDeselectAll"), SNAME("EditorIcons")));
|
||||
select_all_colors_button->set_icon(get_theme_icon(SNAME("ThemeSelectAll"), SNAME("EditorIcons")));
|
||||
select_full_colors_button->set_icon(get_theme_icon(SNAME("ThemeSelectFull"), SNAME("EditorIcons")));
|
||||
select_colors_icon->set_texture(get_editor_theme_icon(SNAME("Color")));
|
||||
deselect_all_colors_button->set_icon(get_editor_theme_icon(SNAME("ThemeDeselectAll")));
|
||||
select_all_colors_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectAll")));
|
||||
select_full_colors_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectFull")));
|
||||
|
||||
select_constants_icon->set_texture(get_theme_icon(SNAME("MemberConstant"), SNAME("EditorIcons")));
|
||||
deselect_all_constants_button->set_icon(get_theme_icon(SNAME("ThemeDeselectAll"), SNAME("EditorIcons")));
|
||||
select_all_constants_button->set_icon(get_theme_icon(SNAME("ThemeSelectAll"), SNAME("EditorIcons")));
|
||||
select_full_constants_button->set_icon(get_theme_icon(SNAME("ThemeSelectFull"), SNAME("EditorIcons")));
|
||||
select_constants_icon->set_texture(get_editor_theme_icon(SNAME("MemberConstant")));
|
||||
deselect_all_constants_button->set_icon(get_editor_theme_icon(SNAME("ThemeDeselectAll")));
|
||||
select_all_constants_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectAll")));
|
||||
select_full_constants_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectFull")));
|
||||
|
||||
select_fonts_icon->set_texture(get_theme_icon(SNAME("Font"), SNAME("EditorIcons")));
|
||||
deselect_all_fonts_button->set_icon(get_theme_icon(SNAME("ThemeDeselectAll"), SNAME("EditorIcons")));
|
||||
select_all_fonts_button->set_icon(get_theme_icon(SNAME("ThemeSelectAll"), SNAME("EditorIcons")));
|
||||
select_full_fonts_button->set_icon(get_theme_icon(SNAME("ThemeSelectFull"), SNAME("EditorIcons")));
|
||||
select_fonts_icon->set_texture(get_editor_theme_icon(SNAME("Font")));
|
||||
deselect_all_fonts_button->set_icon(get_editor_theme_icon(SNAME("ThemeDeselectAll")));
|
||||
select_all_fonts_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectAll")));
|
||||
select_full_fonts_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectFull")));
|
||||
|
||||
select_font_sizes_icon->set_texture(get_theme_icon(SNAME("FontSize"), SNAME("EditorIcons")));
|
||||
deselect_all_font_sizes_button->set_icon(get_theme_icon(SNAME("ThemeDeselectAll"), SNAME("EditorIcons")));
|
||||
select_all_font_sizes_button->set_icon(get_theme_icon(SNAME("ThemeSelectAll"), SNAME("EditorIcons")));
|
||||
select_full_font_sizes_button->set_icon(get_theme_icon(SNAME("ThemeSelectFull"), SNAME("EditorIcons")));
|
||||
select_font_sizes_icon->set_texture(get_editor_theme_icon(SNAME("FontSize")));
|
||||
deselect_all_font_sizes_button->set_icon(get_editor_theme_icon(SNAME("ThemeDeselectAll")));
|
||||
select_all_font_sizes_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectAll")));
|
||||
select_full_font_sizes_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectFull")));
|
||||
|
||||
select_icons_icon->set_texture(get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons")));
|
||||
deselect_all_icons_button->set_icon(get_theme_icon(SNAME("ThemeDeselectAll"), SNAME("EditorIcons")));
|
||||
select_all_icons_button->set_icon(get_theme_icon(SNAME("ThemeSelectAll"), SNAME("EditorIcons")));
|
||||
select_full_icons_button->set_icon(get_theme_icon(SNAME("ThemeSelectFull"), SNAME("EditorIcons")));
|
||||
select_icons_icon->set_texture(get_editor_theme_icon(SNAME("ImageTexture")));
|
||||
deselect_all_icons_button->set_icon(get_editor_theme_icon(SNAME("ThemeDeselectAll")));
|
||||
select_all_icons_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectAll")));
|
||||
select_full_icons_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectFull")));
|
||||
|
||||
select_styleboxes_icon->set_texture(get_theme_icon(SNAME("StyleBoxFlat"), SNAME("EditorIcons")));
|
||||
deselect_all_styleboxes_button->set_icon(get_theme_icon(SNAME("ThemeDeselectAll"), SNAME("EditorIcons")));
|
||||
select_all_styleboxes_button->set_icon(get_theme_icon(SNAME("ThemeSelectAll"), SNAME("EditorIcons")));
|
||||
select_full_styleboxes_button->set_icon(get_theme_icon(SNAME("ThemeSelectFull"), SNAME("EditorIcons")));
|
||||
select_styleboxes_icon->set_texture(get_editor_theme_icon(SNAME("StyleBoxFlat")));
|
||||
deselect_all_styleboxes_button->set_icon(get_editor_theme_icon(SNAME("ThemeDeselectAll")));
|
||||
select_all_styleboxes_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectAll")));
|
||||
select_full_styleboxes_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectFull")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1237,14 +1238,14 @@ void ThemeItemEditorDialog::_update_edit_types() {
|
|||
for (const StringName &E : theme_types) {
|
||||
Ref<Texture2D> item_icon;
|
||||
if (E == "") {
|
||||
item_icon = get_theme_icon(SNAME("NodeDisabled"), SNAME("EditorIcons"));
|
||||
item_icon = get_editor_theme_icon(SNAME("NodeDisabled"));
|
||||
} else {
|
||||
item_icon = EditorNode::get_singleton()->get_class_icon(E, "NodeDisabled");
|
||||
}
|
||||
TreeItem *list_item = edit_type_list->create_item(list_root);
|
||||
list_item->set_text(0, E);
|
||||
list_item->set_icon(0, item_icon);
|
||||
list_item->add_button(0, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), TYPES_TREE_REMOVE_ITEM, false, TTR("Remove Type"));
|
||||
list_item->add_button(0, get_editor_theme_icon(SNAME("Remove")), TYPES_TREE_REMOVE_ITEM, false, TTR("Remove Type"));
|
||||
|
||||
if (E == edited_item_type) {
|
||||
list_item->select(0);
|
||||
|
|
@ -1340,16 +1341,16 @@ void ThemeItemEditorDialog::_update_edit_item_tree(String p_item_type) {
|
|||
if (names.size() > 0) {
|
||||
TreeItem *color_root = edit_items_tree->create_item(root);
|
||||
color_root->set_metadata(0, Theme::DATA_TYPE_COLOR);
|
||||
color_root->set_icon(0, get_theme_icon(SNAME("Color"), SNAME("EditorIcons")));
|
||||
color_root->set_icon(0, get_editor_theme_icon(SNAME("Color")));
|
||||
color_root->set_text(0, TTR("Colors"));
|
||||
color_root->add_button(0, get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")), ITEMS_TREE_REMOVE_DATA_TYPE, false, TTR("Remove All Color Items"));
|
||||
color_root->add_button(0, get_editor_theme_icon(SNAME("Clear")), ITEMS_TREE_REMOVE_DATA_TYPE, false, TTR("Remove All Color Items"));
|
||||
|
||||
names.sort_custom<StringName::AlphCompare>();
|
||||
for (const StringName &E : names) {
|
||||
TreeItem *item = edit_items_tree->create_item(color_root);
|
||||
item->set_text(0, E);
|
||||
item->add_button(0, get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")), ITEMS_TREE_RENAME_ITEM, false, TTR("Rename Item"));
|
||||
item->add_button(0, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), ITEMS_TREE_REMOVE_ITEM, false, TTR("Remove Item"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Edit")), ITEMS_TREE_RENAME_ITEM, false, TTR("Rename Item"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Remove")), ITEMS_TREE_REMOVE_ITEM, false, TTR("Remove Item"));
|
||||
}
|
||||
|
||||
has_any_items = true;
|
||||
|
|
@ -1363,16 +1364,16 @@ void ThemeItemEditorDialog::_update_edit_item_tree(String p_item_type) {
|
|||
if (names.size() > 0) {
|
||||
TreeItem *constant_root = edit_items_tree->create_item(root);
|
||||
constant_root->set_metadata(0, Theme::DATA_TYPE_CONSTANT);
|
||||
constant_root->set_icon(0, get_theme_icon(SNAME("MemberConstant"), SNAME("EditorIcons")));
|
||||
constant_root->set_icon(0, get_editor_theme_icon(SNAME("MemberConstant")));
|
||||
constant_root->set_text(0, TTR("Constants"));
|
||||
constant_root->add_button(0, get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")), ITEMS_TREE_REMOVE_DATA_TYPE, false, TTR("Remove All Constant Items"));
|
||||
constant_root->add_button(0, get_editor_theme_icon(SNAME("Clear")), ITEMS_TREE_REMOVE_DATA_TYPE, false, TTR("Remove All Constant Items"));
|
||||
|
||||
names.sort_custom<StringName::AlphCompare>();
|
||||
for (const StringName &E : names) {
|
||||
TreeItem *item = edit_items_tree->create_item(constant_root);
|
||||
item->set_text(0, E);
|
||||
item->add_button(0, get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")), ITEMS_TREE_RENAME_ITEM, false, TTR("Rename Item"));
|
||||
item->add_button(0, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), ITEMS_TREE_REMOVE_ITEM, false, TTR("Remove Item"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Edit")), ITEMS_TREE_RENAME_ITEM, false, TTR("Rename Item"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Remove")), ITEMS_TREE_REMOVE_ITEM, false, TTR("Remove Item"));
|
||||
}
|
||||
|
||||
has_any_items = true;
|
||||
|
|
@ -1386,16 +1387,16 @@ void ThemeItemEditorDialog::_update_edit_item_tree(String p_item_type) {
|
|||
if (names.size() > 0) {
|
||||
TreeItem *font_root = edit_items_tree->create_item(root);
|
||||
font_root->set_metadata(0, Theme::DATA_TYPE_FONT);
|
||||
font_root->set_icon(0, get_theme_icon(SNAME("Font"), SNAME("EditorIcons")));
|
||||
font_root->set_icon(0, get_editor_theme_icon(SNAME("Font")));
|
||||
font_root->set_text(0, TTR("Fonts"));
|
||||
font_root->add_button(0, get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")), ITEMS_TREE_REMOVE_DATA_TYPE, false, TTR("Remove All Font Items"));
|
||||
font_root->add_button(0, get_editor_theme_icon(SNAME("Clear")), ITEMS_TREE_REMOVE_DATA_TYPE, false, TTR("Remove All Font Items"));
|
||||
|
||||
names.sort_custom<StringName::AlphCompare>();
|
||||
for (const StringName &E : names) {
|
||||
TreeItem *item = edit_items_tree->create_item(font_root);
|
||||
item->set_text(0, E);
|
||||
item->add_button(0, get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")), ITEMS_TREE_RENAME_ITEM, false, TTR("Rename Item"));
|
||||
item->add_button(0, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), ITEMS_TREE_REMOVE_ITEM, false, TTR("Remove Item"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Edit")), ITEMS_TREE_RENAME_ITEM, false, TTR("Rename Item"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Remove")), ITEMS_TREE_REMOVE_ITEM, false, TTR("Remove Item"));
|
||||
}
|
||||
|
||||
has_any_items = true;
|
||||
|
|
@ -1409,16 +1410,16 @@ void ThemeItemEditorDialog::_update_edit_item_tree(String p_item_type) {
|
|||
if (names.size() > 0) {
|
||||
TreeItem *font_size_root = edit_items_tree->create_item(root);
|
||||
font_size_root->set_metadata(0, Theme::DATA_TYPE_FONT_SIZE);
|
||||
font_size_root->set_icon(0, get_theme_icon(SNAME("FontSize"), SNAME("EditorIcons")));
|
||||
font_size_root->set_icon(0, get_editor_theme_icon(SNAME("FontSize")));
|
||||
font_size_root->set_text(0, TTR("Font Sizes"));
|
||||
font_size_root->add_button(0, get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")), ITEMS_TREE_REMOVE_DATA_TYPE, false, TTR("Remove All Font Size Items"));
|
||||
font_size_root->add_button(0, get_editor_theme_icon(SNAME("Clear")), ITEMS_TREE_REMOVE_DATA_TYPE, false, TTR("Remove All Font Size Items"));
|
||||
|
||||
names.sort_custom<StringName::AlphCompare>();
|
||||
for (const StringName &E : names) {
|
||||
TreeItem *item = edit_items_tree->create_item(font_size_root);
|
||||
item->set_text(0, E);
|
||||
item->add_button(0, get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")), ITEMS_TREE_RENAME_ITEM, false, TTR("Rename Item"));
|
||||
item->add_button(0, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), ITEMS_TREE_REMOVE_ITEM, false, TTR("Remove Item"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Edit")), ITEMS_TREE_RENAME_ITEM, false, TTR("Rename Item"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Remove")), ITEMS_TREE_REMOVE_ITEM, false, TTR("Remove Item"));
|
||||
}
|
||||
|
||||
has_any_items = true;
|
||||
|
|
@ -1432,16 +1433,16 @@ void ThemeItemEditorDialog::_update_edit_item_tree(String p_item_type) {
|
|||
if (names.size() > 0) {
|
||||
TreeItem *icon_root = edit_items_tree->create_item(root);
|
||||
icon_root->set_metadata(0, Theme::DATA_TYPE_ICON);
|
||||
icon_root->set_icon(0, get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons")));
|
||||
icon_root->set_icon(0, get_editor_theme_icon(SNAME("ImageTexture")));
|
||||
icon_root->set_text(0, TTR("Icons"));
|
||||
icon_root->add_button(0, get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")), ITEMS_TREE_REMOVE_DATA_TYPE, false, TTR("Remove All Icon Items"));
|
||||
icon_root->add_button(0, get_editor_theme_icon(SNAME("Clear")), ITEMS_TREE_REMOVE_DATA_TYPE, false, TTR("Remove All Icon Items"));
|
||||
|
||||
names.sort_custom<StringName::AlphCompare>();
|
||||
for (const StringName &E : names) {
|
||||
TreeItem *item = edit_items_tree->create_item(icon_root);
|
||||
item->set_text(0, E);
|
||||
item->add_button(0, get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")), ITEMS_TREE_RENAME_ITEM, false, TTR("Rename Item"));
|
||||
item->add_button(0, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), ITEMS_TREE_REMOVE_ITEM, false, TTR("Remove Item"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Edit")), ITEMS_TREE_RENAME_ITEM, false, TTR("Rename Item"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Remove")), ITEMS_TREE_REMOVE_ITEM, false, TTR("Remove Item"));
|
||||
}
|
||||
|
||||
has_any_items = true;
|
||||
|
|
@ -1455,16 +1456,16 @@ void ThemeItemEditorDialog::_update_edit_item_tree(String p_item_type) {
|
|||
if (names.size() > 0) {
|
||||
TreeItem *stylebox_root = edit_items_tree->create_item(root);
|
||||
stylebox_root->set_metadata(0, Theme::DATA_TYPE_STYLEBOX);
|
||||
stylebox_root->set_icon(0, get_theme_icon(SNAME("StyleBoxFlat"), SNAME("EditorIcons")));
|
||||
stylebox_root->set_icon(0, get_editor_theme_icon(SNAME("StyleBoxFlat")));
|
||||
stylebox_root->set_text(0, TTR("Styleboxes"));
|
||||
stylebox_root->add_button(0, get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")), ITEMS_TREE_REMOVE_DATA_TYPE, false, TTR("Remove All StyleBox Items"));
|
||||
stylebox_root->add_button(0, get_editor_theme_icon(SNAME("Clear")), ITEMS_TREE_REMOVE_DATA_TYPE, false, TTR("Remove All StyleBox Items"));
|
||||
|
||||
names.sort_custom<StringName::AlphCompare>();
|
||||
for (const StringName &E : names) {
|
||||
TreeItem *item = edit_items_tree->create_item(stylebox_root);
|
||||
item->set_text(0, E);
|
||||
item->add_button(0, get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")), ITEMS_TREE_RENAME_ITEM, false, TTR("Rename Item"));
|
||||
item->add_button(0, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), ITEMS_TREE_REMOVE_ITEM, false, TTR("Remove Item"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Edit")), ITEMS_TREE_RENAME_ITEM, false, TTR("Rename Item"));
|
||||
item->add_button(0, get_editor_theme_icon(SNAME("Remove")), ITEMS_TREE_REMOVE_ITEM, false, TTR("Remove Item"));
|
||||
}
|
||||
|
||||
has_any_items = true;
|
||||
|
|
@ -1872,20 +1873,20 @@ void ThemeItemEditorDialog::_notification(int p_what) {
|
|||
[[fallthrough]];
|
||||
}
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
edit_items_add_color->set_icon(get_theme_icon(SNAME("Color"), SNAME("EditorIcons")));
|
||||
edit_items_add_constant->set_icon(get_theme_icon(SNAME("MemberConstant"), SNAME("EditorIcons")));
|
||||
edit_items_add_font->set_icon(get_theme_icon(SNAME("Font"), SNAME("EditorIcons")));
|
||||
edit_items_add_font_size->set_icon(get_theme_icon(SNAME("FontSize"), SNAME("EditorIcons")));
|
||||
edit_items_add_icon->set_icon(get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons")));
|
||||
edit_items_add_stylebox->set_icon(get_theme_icon(SNAME("StyleBoxFlat"), SNAME("EditorIcons")));
|
||||
edit_items_add_color->set_icon(get_editor_theme_icon(SNAME("Color")));
|
||||
edit_items_add_constant->set_icon(get_editor_theme_icon(SNAME("MemberConstant")));
|
||||
edit_items_add_font->set_icon(get_editor_theme_icon(SNAME("Font")));
|
||||
edit_items_add_font_size->set_icon(get_editor_theme_icon(SNAME("FontSize")));
|
||||
edit_items_add_icon->set_icon(get_editor_theme_icon(SNAME("ImageTexture")));
|
||||
edit_items_add_stylebox->set_icon(get_editor_theme_icon(SNAME("StyleBoxFlat")));
|
||||
|
||||
edit_items_remove_class->set_icon(get_theme_icon(SNAME("Control"), SNAME("EditorIcons")));
|
||||
edit_items_remove_custom->set_icon(get_theme_icon(SNAME("ThemeRemoveCustomItems"), SNAME("EditorIcons")));
|
||||
edit_items_remove_all->set_icon(get_theme_icon(SNAME("ThemeRemoveAllItems"), SNAME("EditorIcons")));
|
||||
edit_items_remove_class->set_icon(get_editor_theme_icon(SNAME("Control")));
|
||||
edit_items_remove_custom->set_icon(get_editor_theme_icon(SNAME("ThemeRemoveCustomItems")));
|
||||
edit_items_remove_all->set_icon(get_editor_theme_icon(SNAME("ThemeRemoveAllItems")));
|
||||
|
||||
edit_add_type_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
edit_add_type_button->set_icon(get_editor_theme_icon(SNAME("Add")));
|
||||
|
||||
import_another_theme_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
import_another_theme_button->set_icon(get_editor_theme_icon(SNAME("Folder")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
|
@ -2154,7 +2155,7 @@ void ThemeTypeDialog::_update_add_type_options(const String &p_filter) {
|
|||
|
||||
Ref<Texture2D> item_icon;
|
||||
if (E == "") {
|
||||
item_icon = get_theme_icon(SNAME("NodeDisabled"), SNAME("EditorIcons"));
|
||||
item_icon = get_editor_theme_icon(SNAME("NodeDisabled"));
|
||||
} else {
|
||||
item_icon = EditorNode::get_singleton()->get_class_icon(E, "NodeDisabled");
|
||||
}
|
||||
|
|
@ -2329,7 +2330,7 @@ void ThemeTypeEditor::_update_type_list() {
|
|||
for (const StringName &E : theme_types) {
|
||||
Ref<Texture2D> item_icon;
|
||||
if (E == "") {
|
||||
item_icon = get_theme_icon(SNAME("NodeDisabled"), SNAME("EditorIcons"));
|
||||
item_icon = get_editor_theme_icon(SNAME("NodeDisabled"));
|
||||
} else {
|
||||
item_icon = EditorNode::get_singleton()->get_class_icon(E, "NodeDisabled");
|
||||
}
|
||||
|
|
@ -2428,21 +2429,21 @@ HBoxContainer *ThemeTypeEditor::_create_property_control(Theme::DataType p_data_
|
|||
item_name_edit->hide();
|
||||
|
||||
Button *item_rename_button = memnew(Button);
|
||||
item_rename_button->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
|
||||
item_rename_button->set_icon(get_editor_theme_icon(SNAME("Edit")));
|
||||
item_rename_button->set_tooltip_text(TTR("Rename Item"));
|
||||
item_rename_button->set_flat(true);
|
||||
item_name_container->add_child(item_rename_button);
|
||||
item_rename_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_rename_cbk).bind(p_data_type, p_item_name, item_name_container));
|
||||
|
||||
Button *item_remove_button = memnew(Button);
|
||||
item_remove_button->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
|
||||
item_remove_button->set_icon(get_editor_theme_icon(SNAME("Remove")));
|
||||
item_remove_button->set_tooltip_text(TTR("Remove Item"));
|
||||
item_remove_button->set_flat(true);
|
||||
item_name_container->add_child(item_remove_button);
|
||||
item_remove_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_remove_cbk).bind(p_data_type, p_item_name));
|
||||
|
||||
Button *item_rename_confirm_button = memnew(Button);
|
||||
item_rename_confirm_button->set_icon(get_theme_icon(SNAME("ImportCheck"), SNAME("EditorIcons")));
|
||||
item_rename_confirm_button->set_icon(get_editor_theme_icon(SNAME("ImportCheck")));
|
||||
item_rename_confirm_button->set_tooltip_text(TTR("Confirm Item Rename"));
|
||||
item_rename_confirm_button->set_flat(true);
|
||||
item_name_container->add_child(item_rename_confirm_button);
|
||||
|
|
@ -2450,17 +2451,17 @@ HBoxContainer *ThemeTypeEditor::_create_property_control(Theme::DataType p_data_
|
|||
item_rename_confirm_button->hide();
|
||||
|
||||
Button *item_rename_cancel_button = memnew(Button);
|
||||
item_rename_cancel_button->set_icon(get_theme_icon(SNAME("ImportFail"), SNAME("EditorIcons")));
|
||||
item_rename_cancel_button->set_icon(get_editor_theme_icon(SNAME("ImportFail")));
|
||||
item_rename_cancel_button->set_tooltip_text(TTR("Cancel Item Rename"));
|
||||
item_rename_cancel_button->set_flat(true);
|
||||
item_name_container->add_child(item_rename_cancel_button);
|
||||
item_rename_cancel_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_rename_canceled).bind(p_data_type, p_item_name, item_name_container));
|
||||
item_rename_cancel_button->hide();
|
||||
} else {
|
||||
item_name->add_theme_color_override("font_color", get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
|
||||
item_name->add_theme_color_override("font_color", get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor)));
|
||||
|
||||
Button *item_override_button = memnew(Button);
|
||||
item_override_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
item_override_button->set_icon(get_editor_theme_icon(SNAME("Add")));
|
||||
item_override_button->set_tooltip_text(TTR("Override Item"));
|
||||
item_override_button->set_flat(true);
|
||||
item_name_container->add_child(item_override_button);
|
||||
|
|
@ -2670,7 +2671,7 @@ void ThemeTypeEditor::_update_type_items() {
|
|||
pin_leader_button->set_flat(true);
|
||||
pin_leader_button->set_toggle_mode(true);
|
||||
pin_leader_button->set_pressed(true);
|
||||
pin_leader_button->set_icon(get_theme_icon(SNAME("Pin"), SNAME("EditorIcons")));
|
||||
pin_leader_button->set_icon(get_editor_theme_icon(SNAME("Pin")));
|
||||
pin_leader_button->set_tooltip_text(TTR("Unpin this StyleBox as a main style."));
|
||||
item_control->add_child(pin_leader_button);
|
||||
pin_leader_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_on_unpin_leader_button_pressed));
|
||||
|
|
@ -2713,7 +2714,7 @@ void ThemeTypeEditor::_update_type_items() {
|
|||
Button *pin_leader_button = memnew(Button);
|
||||
pin_leader_button->set_flat(true);
|
||||
pin_leader_button->set_toggle_mode(true);
|
||||
pin_leader_button->set_icon(get_theme_icon(SNAME("Pin"), SNAME("EditorIcons")));
|
||||
pin_leader_button->set_icon(get_editor_theme_icon(SNAME("Pin")));
|
||||
pin_leader_button->set_tooltip_text(TTR("Pin this StyleBox as a main style. Editing its properties will update the same properties in all other StyleBoxes of this type."));
|
||||
item_control->add_child(pin_leader_button);
|
||||
pin_leader_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_on_pin_leader_button_pressed).bind(item_editor, E.key));
|
||||
|
|
@ -3313,17 +3314,17 @@ void ThemeTypeEditor::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
add_type_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
add_type_button->set_icon(get_editor_theme_icon(SNAME("Add")));
|
||||
|
||||
data_type_tabs->set_tab_icon(0, get_theme_icon(SNAME("Color"), SNAME("EditorIcons")));
|
||||
data_type_tabs->set_tab_icon(1, get_theme_icon(SNAME("MemberConstant"), SNAME("EditorIcons")));
|
||||
data_type_tabs->set_tab_icon(2, get_theme_icon(SNAME("Font"), SNAME("EditorIcons")));
|
||||
data_type_tabs->set_tab_icon(3, get_theme_icon(SNAME("FontSize"), SNAME("EditorIcons")));
|
||||
data_type_tabs->set_tab_icon(4, get_theme_icon(SNAME("ImageTexture"), SNAME("EditorIcons")));
|
||||
data_type_tabs->set_tab_icon(5, get_theme_icon(SNAME("StyleBoxFlat"), SNAME("EditorIcons")));
|
||||
data_type_tabs->set_tab_icon(6, get_theme_icon(SNAME("Tools"), SNAME("EditorIcons")));
|
||||
data_type_tabs->set_tab_icon(0, get_editor_theme_icon(SNAME("Color")));
|
||||
data_type_tabs->set_tab_icon(1, get_editor_theme_icon(SNAME("MemberConstant")));
|
||||
data_type_tabs->set_tab_icon(2, get_editor_theme_icon(SNAME("Font")));
|
||||
data_type_tabs->set_tab_icon(3, get_editor_theme_icon(SNAME("FontSize")));
|
||||
data_type_tabs->set_tab_icon(4, get_editor_theme_icon(SNAME("ImageTexture")));
|
||||
data_type_tabs->set_tab_icon(5, get_editor_theme_icon(SNAME("StyleBoxFlat")));
|
||||
data_type_tabs->set_tab_icon(6, get_editor_theme_icon(SNAME("Tools")));
|
||||
|
||||
type_variation_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
type_variation_button->set_icon(get_editor_theme_icon(SNAME("Add")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
|
@ -3537,7 +3538,7 @@ void ThemeEditor::_preview_scene_dialog_cbk(const String &p_path) {
|
|||
return;
|
||||
}
|
||||
|
||||
_add_preview_tab(preview_tab, p_path.get_file(), get_theme_icon(SNAME("PackedScene"), SNAME("EditorIcons")));
|
||||
_add_preview_tab(preview_tab, p_path.get_file(), get_editor_theme_icon(SNAME("PackedScene")));
|
||||
preview_tab->connect("scene_invalidated", callable_mp(this, &ThemeEditor::_remove_preview_tab_invalid).bind(preview_tab));
|
||||
preview_tab->connect("scene_reloaded", callable_mp(this, &ThemeEditor::_update_preview_tab).bind(preview_tab));
|
||||
}
|
||||
|
|
@ -3610,11 +3611,11 @@ void ThemeEditor::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
preview_tabs->add_theme_style_override("tab_selected", get_theme_stylebox(SNAME("ThemeEditorPreviewFG"), SNAME("EditorStyles")));
|
||||
preview_tabs->add_theme_style_override("tab_unselected", get_theme_stylebox(SNAME("ThemeEditorPreviewBG"), SNAME("EditorStyles")));
|
||||
preview_tabs->add_theme_style_override("tab_selected", get_theme_stylebox(SNAME("ThemeEditorPreviewFG"), EditorStringName(EditorStyles)));
|
||||
preview_tabs->add_theme_style_override("tab_unselected", get_theme_stylebox(SNAME("ThemeEditorPreviewBG"), EditorStringName(EditorStyles)));
|
||||
preview_tabs_content->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TabContainerOdd")));
|
||||
|
||||
add_preview_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
add_preview_button->set_icon(get_editor_theme_icon(SNAME("Add")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue