diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-05-26 00:57:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-26 00:57:21 +0200 |
commit | ff75a49227d8d81f99b728fc89b1e4e6e79ed5be (patch) | |
tree | d48cb90cddf4a60343cb417d6d54ae536a9b41d3 /editor/editor_properties_array_dict.cpp | |
parent | 0736eed7471a84afa0699d3ec0e6ee9899c7ae26 (diff) | |
parent | e7b0e7e35aedd85a11480654e353e53b02a6a031 (diff) |
Merge pull request #61387 from KoBeWi/press_to_action
Improve style of inspector buttons
Diffstat (limited to 'editor/editor_properties_array_dict.cpp')
-rw-r--r-- | editor/editor_properties_array_dict.cpp | 9 |
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); |