-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
Add option to TreeNode to enable button behaviour with key modifiers enabled. #2886
Comments
Which tree node flags are you using? Are you using My gut feeling is that for tree node it would make sense to allow toggling the node open state with modifiers when clicking specifically on the arrow, so we could alter the behavior based on mouse position. I'll have to check with Potential fix would be to move the arrow_x1/arrow_x2 declaration higher in the function and alter the button flags based on (Also need to consider Also consider looking at #1861 and the (PS: Please fill the issue template as requested when creating a new issue.) |
I applied the change described above now. In addition, I have added |
Thank you for the quick fix, it is exactly what I needed. I was using ImGuiTreeNodeFlags_SpanFullWidth and doing a range check to see if the mouse was in the arrow area when clicked using the TreeDepth, but with IsItemToggledOpen() should be way easier and cleaner. And sorry for the template, I must have cleared the text and forgot about it completely. |
Hi, I am working on a multiselection tree hierarchy and using LCTRL as the modifier to select multiple items. My idea is to be able to while holding down the LCTRL key, open a tree node if I click on the arrow. Right now, the default behaviour of the button behaviour inside the TreeNode is to include the ImGuiButtonFlags_NoKeyModifiers flag which prevents me from doing so.
I have manually removed the default flag, but I guess having a proper way of disabling this behaviour would be the ideal solution.
Thanks.
The text was updated successfully, but these errors were encountered: