summaryrefslogtreecommitdiff
path: root/editor/editor_properties_array_dict.cpp
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-05-25 01:38:13 +0200
committerkobewi <kobewi4e@gmail.com>2022-05-25 22:54:47 +0200
commite7b0e7e35aedd85a11480654e353e53b02a6a031 (patch)
tree198bf16b1696ce8651b414c70c64222423ed6af8 /editor/editor_properties_array_dict.cpp
parent360119ffbf3e7690971fe54d3772cb3dffd004ad (diff)
Improve style of inspector buttons
Diffstat (limited to 'editor/editor_properties_array_dict.cpp')
-rw-r--r--editor/editor_properties_array_dict.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp
index 608121d806..cdbe2fa1d3 100644
--- a/editor/editor_properties_array_dict.cpp
+++ b/editor/editor_properties_array_dict.cpp
@@ -264,8 +264,7 @@ void EditorPropertyArray::update_property() {
property_vbox->set_h_size_flags(SIZE_EXPAND_FILL);
vbox->add_child(property_vbox);
- button_add_item = memnew(Button);
- button_add_item->set_text(TTR("Add Element"));
+ 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->connect(SNAME("pressed"), callable_mp(this, &EditorPropertyArray::_add_element));
vbox->add_child(button_add_item);
@@ -1107,8 +1106,7 @@ void EditorPropertyDictionary::update_property() {
prop->update_property();
if (i == amount + 1) {
- button_add_item = memnew(Button);
- button_add_item->set_text(TTR("Add Key/Value Pair"));
+ 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->connect("pressed", callable_mp(this, &EditorPropertyDictionary::_add_key_value));
add_vbox->add_child(button_add_item);
@@ -1344,8 +1342,7 @@ void EditorPropertyLocalizableString::update_property() {
}
if (page_index == max_page) {
- button_add_item = memnew(Button);
- button_add_item->set_text(TTR("Add Translation"));
+ 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->connect("pressed", callable_mp(this, &EditorPropertyLocalizableString::_add_locale_popup));
property_vbox->add_child(button_add_item);