diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-02-22 16:29:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-22 16:29:03 +0100 |
commit | cb29e6c49cde181999435c7f8284bce2d20ab7d8 (patch) | |
tree | c90e587316d8a79a19102e8c5526105b1342b14f | |
parent | a0cb81b1192cf8b6fd38f5ec90b637f65c4012e7 (diff) | |
parent | 13fb24cb6f9ebabb7097aad05550a406022b4c92 (diff) |
Merge pull request #45994 from Jummit/expose-edit-selected
Expose edit_selected in Tree
-rw-r--r-- | doc/classes/Tree.xml | 7 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index f1e799898d..8502707096 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -57,6 +57,13 @@ The new item will be the [code]idx[/code]th child of parent, or it will be the last child if there are not enough siblings. </description> </method> + <method name="edit_selected"> + <return type="bool"> + </return> + <description> + Edits the selected tree item as if it was clicked. The item must be set editable with [method TreeItem.set_editable]. Returns [code]true[/code] if the item could be edited. Fails if no item is selected. + </description> + </method> <method name="ensure_cursor_is_visible"> <return type="void"> </return> diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index ad06739da9..17fe001b5d 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -4187,6 +4187,7 @@ void Tree::_bind_methods() { ClassDB::bind_method(D_METHOD("get_edited"), &Tree::get_edited); ClassDB::bind_method(D_METHOD("get_edited_column"), &Tree::get_edited_column); + ClassDB::bind_method(D_METHOD("edit_selected"), &Tree::edit_selected); ClassDB::bind_method(D_METHOD("get_custom_popup_rect"), &Tree::get_custom_popup_rect); ClassDB::bind_method(D_METHOD("get_item_area_rect", "item", "column"), &Tree::_get_item_rect, DEFVAL(-1)); ClassDB::bind_method(D_METHOD("get_item_at_position", "position"), &Tree::get_item_at_position); |