diff options
author | Christoph Nelles <github@evilazrael.de> | 2022-01-01 21:36:18 +0100 |
---|---|---|
committer | none@none <none@none> | 2022-01-02 00:36:30 +0000 |
commit | 185724e5e95a4044ac0db857fa6d237907817237 (patch) | |
tree | 427473ab4c0b8a243f3eb25a3cfe57e71ee583ed /scene | |
parent | bc2445d0eb1b4d00de7506fbea4384212c8dfe16 (diff) |
Tree: Fix de-select when selection mode set to SELECT_ROW
It no longer de-selects an already selected row if the SELECT_MODE is
set to SELECT_ROW.
Update scene/gui/tree.cpp
Co-authored-by: Michael Alexsander <michaelalexsander@protonmail.com>
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/tree.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 5a6ac7c0d2..9dd9b7e252 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2195,8 +2195,10 @@ void Tree::select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_c */ } else if (c.selected) { - c.selected = false; - //p_current->deselected_signal.call(p_col); + if (p_selected != p_current) { + // Deselect other rows. + c.selected = false; + } } } else if (select_mode == SELECT_SINGLE || select_mode == SELECT_MULTI) { if (!r_in_range && &selected_cell == &c) { |