You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why?
I've had a few different projects where I've used CollapsingHeader and have not been a fan of the way the edges of the header leak outwards onto the side, there is currently no real solution to this besides hacky approaches. The current logic is to add this 'outer padding' if the 'ImGuiTreeNodeFlags_Framed' is applied.
In my UIs when this collapsible header lives on a sidebar I don't think it looks very nice when its misaligned with contents.
Previous solution
My previous solution to this was to access window->WindowPadding and set it to (0, 0) for the TreeNodeEx/CollapsingHeader function call, but this solution is ugly and hacky.
@RegimantasSimkus I have an unrelated question:
How did you make the 'Lorem ipsum' and 'Eos maiores' rectangular sections with a border and label?
I haven't found a way to do it in imgui and I was about to submit a PR with my own implementation of it until I randomly found your post.
I am very curious to know if their is already a way to do it.
@RegimantasSimkus I have an unrelated question: How did you make the 'Lorem ipsum' and 'Eos maiores' rectangular sections with a border and label? I haven't found a way to do it in imgui and I was about to submit a PR with my own implementation of it until I randomly found your post. I am very curious to know if their is already a way to do it.
custom component, it's a wrapper around BeginChild+padding and utilises ImGuiDrawList to draw the borders & title.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added ImGuiTreeNodeFlags_NoFrameOuterPadding.
Why?
I've had a few different projects where I've used CollapsingHeader and have not been a fan of the way the edges of the header leak outwards onto the side, there is currently no real solution to this besides hacky approaches. The current logic is to add this 'outer padding' if the 'ImGuiTreeNodeFlags_Framed' is applied.
In my UIs when this collapsible header lives on a sidebar I don't think it looks very nice when its misaligned with contents.
Previous solution
My previous solution to this was to access
window->WindowPaddingand set it to (0, 0) for the TreeNodeEx/CollapsingHeader function call, but this solution is ugly and hacky.New solution
Before


After


Nicely aligned