Improve TreeItem API and allow to move nodes

This commit is contained in:
trollodel 2021-03-07 21:07:30 +01:00
parent 92c04fa727
commit bca0d36fe6
28 changed files with 527 additions and 289 deletions

View file

@ -795,7 +795,7 @@ void ProjectExportDialog::_tree_changed() {
}
void ProjectExportDialog::_check_dir_recursive(TreeItem *p_dir, bool p_checked) {
for (TreeItem *child = p_dir->get_children(); child; child = child->get_next()) {
for (TreeItem *child = p_dir->get_first_child(); child; child = child->get_next()) {
String path = child->get_metadata(0);
child->set_checked(0, p_checked);
@ -818,7 +818,7 @@ void ProjectExportDialog::_refresh_parent_checks(TreeItem *p_item) {
}
bool checked = true;
for (TreeItem *child = parent->get_children(); child; child = child->get_next()) {
for (TreeItem *child = parent->get_first_child(); child; child = child->get_next()) {
checked = checked && child->is_checked(0);
if (!checked) {
break;