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 (mvTreeNode/mvCollapsingHeader): Keep the open state when parent … #2251

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

v-ein
Copy link
Contributor

@v-ein v-ein commented Jan 10, 2024

…window is hidden #1873


name: Pull Request
about: Create a pull request to help us improve
title: fix (mvTreeNode/mvCollapsingHeader): Keep the open state when parent window is hidden #1873
assignees: @hoffstadt


Closes #1873

Description:

This is an attempt to make the fix better than #2250.

The problem is caused by TreeNode functions returning false when the window is not visible, and we surely don't want that false to interfere with the widget's value. That's why we only store the TreeNodeEx return value when it really comes from user interaction (toggledOpen is true). If the window is hidden, toggledOpen can never turn into true, so it's a safe approach. Also, this way we don't have to explicitly check window->SkipItems, which is an internal API in Dear ImGui (I try to cut down on the use of internal-looking APIs :) ).

Concerning Areas:
None.

@hoffstadt hoffstadt merged commit 8991707 into hoffstadt:master Jan 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tree nodes and collapsing headers close when the viewport is minimised
2 participants