summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-05-26 00:57:21 +0200
committerGitHub <noreply@github.com>2022-05-26 00:57:21 +0200
commitff75a49227d8d81f99b728fc89b1e4e6e79ed5be (patch)
treed48cb90cddf4a60343cb417d6d54ae536a9b41d3 /editor/plugins
parent0736eed7471a84afa0699d3ec0e6ee9899c7ae26 (diff)
parente7b0e7e35aedd85a11480654e353e53b02a6a031 (diff)
Merge pull request #61387 from KoBeWi/press_to_action
Improve style of inspector buttons
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index 2b24ebaebd..79e09404a0 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -1141,8 +1141,7 @@ void EditorInspectorPluginTextureRegion::_region_edit(Object *p_object) {
bool EditorInspectorPluginTextureRegion::parse_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide) {
if ((p_type == Variant::RECT2 || p_type == Variant::RECT2I)) {
if (((Object::cast_to<Sprite2D>(p_object) || Object::cast_to<Sprite3D>(p_object) || Object::cast_to<NinePatchRect>(p_object) || Object::cast_to<StyleBoxTexture>(p_object)) && p_path == "region_rect") || (Object::cast_to<AtlasTexture>(p_object) && p_path == "region")) {
- Button *button = memnew(Button);
- button->set_text(TTR("Edit Region"));
+ Button *button = EditorInspector::create_inspector_action_button(TTR("Edit Region"));
button->set_icon(texture_region_editor->get_theme_icon(SNAME("RegionEdit"), SNAME("EditorIcons")));
button->connect("pressed", callable_mp(this, &EditorInspectorPluginTextureRegion::_region_edit), varray(p_object));
add_property_editor(p_path, button, true);