Merge pull request #71405 from marzecdawid/deselect-root-in-deselect_all
Fix `Tree::deselect_all` not deselecting root
This commit is contained in:
commit
c0301b74a1
1 changed files with 13 additions and 7 deletions
|
@ -4219,14 +4219,20 @@ Tree::SelectMode Tree::get_select_mode() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tree::deselect_all() {
|
void Tree::deselect_all() {
|
||||||
TreeItem *item = get_next_selected(get_root());
|
if (root) {
|
||||||
while (item) {
|
TreeItem *item = root;
|
||||||
for (int i = 0; i < columns.size(); i++) {
|
while (item) {
|
||||||
item->deselect(i);
|
if (select_mode == SELECT_ROW) {
|
||||||
|
item->deselect(0);
|
||||||
|
} else {
|
||||||
|
for (int i = 0; i < columns.size(); i++) {
|
||||||
|
item->deselect(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TreeItem *prev_item = item;
|
||||||
|
item = get_next_selected(root);
|
||||||
|
ERR_FAIL_COND(item == prev_item);
|
||||||
}
|
}
|
||||||
TreeItem *prev_item = item;
|
|
||||||
item = get_next_selected(get_root());
|
|
||||||
ERR_FAIL_COND(item == prev_item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
selected_item = nullptr;
|
selected_item = nullptr;
|
||||||
|
|
Loading…
Reference in a new issue