-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Background color for content inside CollapsingHeader #3647
Comments
Hello, CollapsingHeader doesn't know anything of its "contents", since it's not even a bounded widget (it doesn't have an pop/end call).
The simplest solution currently would be:
From my pov this is a little unefficient for very frequent use but at that the sort of granularity you are showing, the cost should be negligible. To be able to provide a BeginSelectable/EndSelectable thing down the line we would need to implement a more optimal a variation of that, which to avoid changing ImDrawList renderer specs would be something like:
This only requires us to know ahead of the vertices count which is something we can solve. |
Note that the solution is much easier to implement if you use a non-filled shape and just an outline, since you can totally remove using the splitter and out-of-order rendering. |
@ocornut Thank you! Could you please give me a basic code example? as I feel a bit overwhelmed :( |
Easiest way I can think of would be setting the child background color and used a child window. |
I am implementing a mini neural-net framework, and displaying each neural-layer under a
CollapsingHeader
.Usually, it has 3 columns with some data, and a graph from ImPlot. (like on screenshot below)
I know I can change the color of the
CollapsingHeader
, usingPushStyleColor()
but how can I have a background for the frame that it renders, when the header is open?None of the
ImGuiCol_
seem to work :/The only solution I can think of, is to somehow render the UI section in two passes:
Is there a simpler solution? ...I can't find it in demo, sorry if I missed it
I want background color for this part, under CollapsingHeader:
The text was updated successfully, but these errors were encountered: