Expose Tree::scroll_to_item()

This commit is contained in:
Pedro J. Estébanez 2021-02-08 02:16:25 +01:00
parent 89a43d9c2e
commit 177b804f30
2 changed files with 5 additions and 0 deletions

View file

@ -4174,6 +4174,7 @@ void Tree::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_column_title_language", "column"), &Tree::get_column_title_language);
ClassDB::bind_method(D_METHOD("get_scroll"), &Tree::get_scroll);
ClassDB::bind_method(D_METHOD("scroll_to_item", "item"), &Tree::_scroll_to_item);
ClassDB::bind_method(D_METHOD("set_hide_folding", "hide"), &Tree::set_hide_folding);
ClassDB::bind_method(D_METHOD("is_folding_hidden"), &Tree::is_folding_hidden);

View file

@ -564,6 +564,10 @@ protected:
return get_item_rect(Object::cast_to<TreeItem>(p_item), p_column);
}
void _scroll_to_item(Object *p_item) {
scroll_to_item(Object::cast_to<TreeItem>(p_item));
}
public:
virtual String get_tooltip(const Point2 &p_pos) const override;