How can make window size elongate with the long title?


#1

How can I should do to make the child window size elongate with the long title.
I have a little bit long title child window. If I use “ImGuiWindowFlags_AlwaysAutoResize” flag for this window. When the CollapsingHeader shrink, this window be uglily.
I can’t find a flag can do this. Maybe I missed it? So I need some help.

My English is not good, hope you can understand this article.
Finally, I would like to thank the developers of ImGui, which has greatly reduced my UI workload. Thank you very much!

normal
shrink


#2

This is not possible at the moment, we don’t feed the window title into the window size.

But you can do:
SetCursorPosX(CalcTextSize(your_title).x);
At the end of your window submission to force it’s automatic size to match the title.


#3

That’s enough to satisfy my thoughts. Thank you very much.