Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Tree check propagation not unchecking parent items #79946

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

Ymanawat
Copy link
Contributor

This PR focuses on 4.x branches and resolves a tree selection bug that exists in various application sections, including theme editor, asset installation and import. The bug caused problems with deselecting parents when all children were deselected.

Fixes : #79942

2023-07-27.13-12-03.1.mp4

Additionally, tested the bug in the 3.5.2 stable version, where parents are automatically checked if any child is selected, and there is no indeterminate check in that version.

@Ymanawat Ymanawat requested a review from a team as a code owner July 27, 2023 07:47
scene/gui/tree.cpp Outdated Show resolved Hide resolved
@AThousandShips AThousandShips added this to the 4.x milestone Jul 27, 2023
scene/gui/tree.cpp Outdated Show resolved Hide resolved
scene/gui/tree.cpp Outdated Show resolved Hide resolved
scene/gui/tree.cpp Outdated Show resolved Hide resolved
@YuriSizov YuriSizov modified the milestones: 4.x, 4.2 Jul 27, 2023
@YuriSizov YuriSizov changed the title Fixed Tree Selection Bug Fixed Tree check propagation not unchecking parent items Jul 27, 2023
@YuriSizov YuriSizov changed the title Fixed Tree check propagation not unchecking parent items Fix Tree check propagation not unchecking parent items Jul 27, 2023
@Ymanawat Ymanawat force-pushed the propagate-check-79942 branch from 3e2a607 to 214440d Compare July 27, 2023 13:38
@Ymanawat
Copy link
Contributor Author

@AThousandShips I've updated the PR, have a look.

@Ymanawat Ymanawat force-pushed the propagate-check-79942 branch from 214440d to 24dbd47 Compare July 27, 2023 14:05
@KoBeWi
Copy link
Member

KoBeWi commented Jul 28, 2023

I tested the newest version of this PR and it doesn't fix the issue.

@Ymanawat Ymanawat force-pushed the propagate-check-79942 branch from 24dbd47 to 2673f70 Compare July 28, 2023 17:44
scene/gui/tree.cpp Outdated Show resolved Hide resolved
@Ymanawat Ymanawat force-pushed the propagate-check-79942 branch from 2673f70 to cf91caf Compare July 28, 2023 17:55
@Ymanawat
Copy link
Contributor Author

@KoBeWi @AThousandShips Actually I've tested the issue then updated the PR, in my local build it was working.

But I think I found that the issue now :

godot/scene/gui/tree.cpp

Lines 186 to 188 in 031aa99

if (cells[p_column].checked == p_checked) {
return;
}

when the check is already false, set by the set_indeterminate function. I'm passing any_checked which is false in case of no child selected, it won't continue to set the indeterminate to false.

cells.write[p_column].indeterminate = false;

I think the changes I made now should fix the issue.

@Ymanawat Ymanawat force-pushed the propagate-check-79942 branch from cf91caf to f0362cd Compare July 28, 2023 19:01
@YuriSizov YuriSizov merged commit 88068a0 into godotengine:master Aug 1, 2023
@YuriSizov
Copy link
Contributor

Thanks! And congrats on your first merged Godot PR!

@Ymanawat Ymanawat deleted the propagate-check-79942 branch August 2, 2023 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tree.propagate_check() does not uncheck parents
5 participants