diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-14 11:12:01 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-14 11:12:01 +0100 |
commit | 5b3a03bf5c7a5bdb5113c4cd81d41c526b751b6d (patch) | |
tree | c5edf6383aa2e0e290ad6bde5d0cc445d5dcd7d5 /scene/gui | |
parent | a90d435e9b7fdb5af8a1da71dd7aecf9bd687451 (diff) | |
parent | 35528b800cf9dacce62f9664a7f4e56fcae491a3 (diff) |
Merge pull request #68448 from bruvzg/font_imp_tr
[Font] Add an import option to pre-render all glyphs required for the translation.
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/tree.cpp | 7 | ||||
-rw-r--r-- | scene/gui/tree.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 1c96858da7..25df4e7932 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -4338,6 +4338,12 @@ TreeItem *Tree::get_selected() const { return selected_item; } +void Tree::set_selected(TreeItem *p_item, int p_column) { + ERR_FAIL_INDEX(p_column, columns.size()); + ERR_FAIL_COND(!p_item); + select_single_item(p_item, get_root(), p_column); +} + int Tree::get_selected_column() const { return selected_col; } @@ -5156,6 +5162,7 @@ void Tree::_bind_methods() { ClassDB::bind_method(D_METHOD("is_root_hidden"), &Tree::is_root_hidden); ClassDB::bind_method(D_METHOD("get_next_selected", "from"), &Tree::get_next_selected); ClassDB::bind_method(D_METHOD("get_selected"), &Tree::get_selected); + ClassDB::bind_method(D_METHOD("set_selected", "item", "column"), &Tree::set_selected); ClassDB::bind_method(D_METHOD("get_selected_column"), &Tree::get_selected_column); ClassDB::bind_method(D_METHOD("get_pressed_button"), &Tree::get_pressed_button); ClassDB::bind_method(D_METHOD("set_select_mode", "mode"), &Tree::set_select_mode); diff --git a/scene/gui/tree.h b/scene/gui/tree.h index f994a5cec1..77a62e1d6a 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -666,6 +666,7 @@ public: bool is_root_hidden() const; TreeItem *get_next_selected(TreeItem *p_item); TreeItem *get_selected() const; + void set_selected(TreeItem *p_item, int p_column = 0); int get_selected_column() const; int get_pressed_button() const; void set_select_mode(SelectMode p_mode); |