-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Column separator/border sizing issue #170
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
Comments
…ly fix more problem than it causes? #170
The problem is a bit tricky. Auto-filling child windows don't notify the parent of their size (intentionally) so it doesn't feed back into auto-fitting measurement (that's used e.g. when you double-click on the lower-right corner). Now to be realistic this feature only work if you use a subset of features, so it's already partly broken (but still useful in many cases). I just made them pass their size to the parent. It will probably solve a few problems including yours. It will also create a few odd cases but they may be on less common path so it is probably a worthy change. The second question: how to extend the columns to the bottom. You can do it simply by positioning the cursor how far you want them to go before closing the column. Unfortunately the exact position that doesn't feed back into auto-fitting is a bit tedious:
style.ItemSpacing.y because closing columns adds spacing. EDIT it's actually trickier than that, that formula is only correct for the top window. Considering removing AutoFitPadding it may simplify several things. |
Sorry about the late response; had a new computer to build and migrate a bunch of our build servers over as a result of newer hardware becoming available! I tried my test program out with the current master and the border sizing behavior with children looks perfect now. With regard to the border extension to bottom, would it be possible to just have another parameter sent in to ImGui::Columns()? Something like:
border_extend = true just automatically assumes you want to use up the rest of the remaining vertical space? Certainly would make things easier for me as the user. What I don't like about this is having a whole extra parameter for something that doesn't apply at all if border = false. |
I was about to add that and decided against. Because Columns() need bigger changes and I want to add them before adding an extra parameter. Perhaps the API itself will change into a BeginColumns()/EndColumns() ? I don't know. But until we have proper header and easy scrolling within a column set it's not worth adding this. |
Back to my columns!
I've been noticing some strange behavior with the column separator/border sizing when a child region is used within the columns. Here is some test code to illustrate:
In the first screenshot, the column separator is the size I would expect. However, in the second screenshot where the child regions are given sizes of zero to automatically use up the remaining space, the separator is tiny and does not match the size of the child region. Finally, in the third, we give an explicit non-zero height and the column separator is going back to what we expect.
Aside from this issue specifically, is there a way to force the column separators to be at least a certain length without actually populating the columns with content? There are some use cases I have where I set up a basic column layout and the columns get filled with user input. At the start, when it's empty, the window is basically completely empty and it feels strange not seeing the borders to show the basic layout.
The text was updated successfully, but these errors were encountered: