Add expand/collapse support to TreeView - #7451
Conversation
|
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
ssheorey
left a comment
There was a problem hiding this comment.
Hi @MiriShulman thanks for reworking the PR! Could you close the old PR, please?
AI Review comments for this one (please verify yourself if they are correct):
1: SetItemExpanded won't actually expand or collapse already-rendered nodes because ImGuiTreeNodeFlags_DefaultOpen only affects the initial state of a tree node. After the first frame, ImGui stores its own internal state and ignores this flag entirely. The codebase already has the correct pattern in Layout.cpp, which uses ImGui::SetNextItemOpen() before the tree node call to override ImGui's stored state. Without that, calling SetItemExpanded sets item.expanded, but on the next draw frame ImGui returns its own stored state, immediately overwriting the value back.
2: The TreeViewTest executable is defined outside the if (BUILD_GUI) guard, so it's always added to the build regardless of whether GUI support is enabled. Since it includes GUI headers (Application.h, Window.h, TreeView.h) and links to Open3D::Open3D expecting GUI symbols, it will fail to compile or link when BUILD_GUI is OFF. The existing test content in the same file is properly guarded.
- git and treeview-clean are accidentally added to the commit.
Let me know if I can help.
Adds expand/collapse support to TreeView.
This introduces:
Fixes #7396