summaryrefslogtreecommitdiffstats
path: root/editor/editor_properties_array_dict.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_properties_array_dict.cpp')
-rw-r--r--editor/editor_properties_array_dict.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp
index 3a84fcb785..61c6c0bcdb 100644
--- a/editor/editor_properties_array_dict.cpp
+++ b/editor/editor_properties_array_dict.cpp
@@ -36,6 +36,7 @@
#include "editor/editor_properties_vector.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
+#include "editor/editor_string_names.h"
#include "editor/gui/editor_spin_slider.h"
#include "editor/inspector_dock.h"
#include "scene/gui/button.h"
@@ -312,7 +313,7 @@ void EditorPropertyArray::update_property() {
vbox->add_child(property_vbox);
button_add_item = EditorInspector::create_inspector_action_button(TTR("Add Element"));
- button_add_item->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
+ button_add_item->set_icon(get_editor_theme_icon(SNAME("Add")));
button_add_item->connect(SNAME("pressed"), callable_mp(this, &EditorPropertyArray::_add_element));
button_add_item->set_disabled(is_read_only());
vbox->add_child(button_add_item);
@@ -357,7 +358,7 @@ void EditorPropertyArray::update_property() {
property_vbox->add_child(hbox);
Button *reorder_button = memnew(Button);
- reorder_button->set_icon(get_theme_icon(SNAME("TripleBar"), SNAME("EditorIcons")));
+ reorder_button->set_icon(get_editor_theme_icon(SNAME("TripleBar")));
reorder_button->set_default_cursor_shape(Control::CURSOR_MOVE);
reorder_button->set_disabled(is_read_only());
reorder_button->connect("gui_input", callable_mp(this, &EditorPropertyArray::_reorder_button_gui_input));
@@ -397,13 +398,13 @@ void EditorPropertyArray::update_property() {
if (is_untyped_array) {
Button *edit_btn = memnew(Button);
- edit_btn->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
+ edit_btn->set_icon(get_editor_theme_icon(SNAME("Edit")));
hbox->add_child(edit_btn);
edit_btn->set_disabled(is_read_only());
edit_btn->connect("pressed", callable_mp(this, &EditorPropertyArray::_change_type).bind(edit_btn, i + offset));
} else {
Button *remove_btn = memnew(Button);
- remove_btn->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
+ remove_btn->set_icon(get_editor_theme_icon(SNAME("Remove")));
remove_btn->set_disabled(is_read_only());
remove_btn->connect("pressed", callable_mp(this, &EditorPropertyArray::_remove_pressed).bind(i + offset));
hbox->add_child(remove_btn);
@@ -438,7 +439,7 @@ void EditorPropertyArray::_remove_pressed(int p_index) {
void EditorPropertyArray::_button_draw() {
if (dropping) {
- Color color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
+ Color color = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
edit->draw_rect(Rect2(Point2(), edit->get_size()), color, false);
}
}
@@ -529,13 +530,13 @@ void EditorPropertyArray::_notification(int p_what) {
}
String type = Variant::get_type_name(Variant::Type(i));
- change_type->add_icon_item(get_theme_icon(type, SNAME("EditorIcons")), type, i);
+ change_type->add_icon_item(get_editor_theme_icon(type), type, i);
}
change_type->add_separator();
- change_type->add_icon_item(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), TTR("Remove Item"), Variant::VARIANT_MAX);
+ change_type->add_icon_item(get_editor_theme_icon(SNAME("Remove")), TTR("Remove Item"), Variant::VARIANT_MAX);
if (button_add_item) {
- button_add_item->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
+ button_add_item->set_icon(get_editor_theme_icon(SNAME("Add")));
}
} break;
@@ -1117,7 +1118,7 @@ void EditorPropertyDictionary::update_property() {
if (i == amount) {
PanelContainer *pc = memnew(PanelContainer);
property_vbox->add_child(pc);
- pc->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("DictionaryAddItem"), SNAME("EditorStyles")));
+ pc->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("DictionaryAddItem"), EditorStringName(EditorStyles)));
add_vbox = memnew(VBoxContainer);
pc->add_child(add_vbox);
@@ -1151,7 +1152,7 @@ void EditorPropertyDictionary::update_property() {
hbox->add_child(prop);
prop->set_h_size_flags(SIZE_EXPAND_FILL);
Button *edit_btn = memnew(Button);
- edit_btn->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
+ edit_btn->set_icon(get_editor_theme_icon(SNAME("Edit")));
edit_btn->set_disabled(is_read_only());
hbox->add_child(edit_btn);
edit_btn->connect("pressed", callable_mp(this, &EditorPropertyDictionary::_change_type).bind(edit_btn, change_index));
@@ -1160,7 +1161,7 @@ void EditorPropertyDictionary::update_property() {
if (i == amount + 1) {
button_add_item = EditorInspector::create_inspector_action_button(TTR("Add Key/Value Pair"));
- button_add_item->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
+ button_add_item->set_icon(get_editor_theme_icon(SNAME("Add")));
button_add_item->set_disabled(is_read_only());
button_add_item->connect("pressed", callable_mp(this, &EditorPropertyDictionary::_add_key_value));
add_vbox->add_child(button_add_item);
@@ -1195,13 +1196,13 @@ void EditorPropertyDictionary::_notification(int p_what) {
}
String type = Variant::get_type_name(Variant::Type(i));
- change_type->add_icon_item(get_theme_icon(type, SNAME("EditorIcons")), type, i);
+ change_type->add_icon_item(get_editor_theme_icon(type), type, i);
}
change_type->add_separator();
- change_type->add_icon_item(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), TTR("Remove Item"), Variant::VARIANT_MAX);
+ change_type->add_icon_item(get_editor_theme_icon(SNAME("Remove")), TTR("Remove Item"), Variant::VARIANT_MAX);
if (button_add_item) {
- button_add_item->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
+ button_add_item->set_icon(get_editor_theme_icon(SNAME("Add")));
}
} break;
}
@@ -1380,7 +1381,7 @@ void EditorPropertyLocalizableString::update_property() {
hbox->add_child(prop);
prop->set_h_size_flags(SIZE_EXPAND_FILL);
Button *edit_btn = memnew(Button);
- edit_btn->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
+ edit_btn->set_icon(get_editor_theme_icon(SNAME("Remove")));
hbox->add_child(edit_btn);
edit_btn->connect("pressed", callable_mp(this, &EditorPropertyLocalizableString::_remove_item).bind(edit_btn, remove_index));
@@ -1389,7 +1390,7 @@ void EditorPropertyLocalizableString::update_property() {
if (page_index == max_page) {
button_add_item = EditorInspector::create_inspector_action_button(TTR("Add Translation"));
- button_add_item->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
+ button_add_item->set_icon(get_editor_theme_icon(SNAME("Add")));
button_add_item->connect("pressed", callable_mp(this, &EditorPropertyLocalizableString::_add_locale_popup));
property_vbox->add_child(button_add_item);
}
@@ -1415,7 +1416,7 @@ void EditorPropertyLocalizableString::_notification(int p_what) {
case NOTIFICATION_THEME_CHANGED:
case NOTIFICATION_ENTER_TREE: {
if (button_add_item) {
- button_add_item->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
+ button_add_item->set_icon(get_editor_theme_icon(SNAME("Add")));
}
} break;
}