-
-
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
Child window with no border seems to be ignoring WindowPadding #462
Comments
The code in Begin() is intentionally doing that:
It sort of made sense because if you don't see a border then the spacing would be odd. But probably it'd be more consistent to not do that and let the user set the WindowPadding to 0.0 if they need it. I'll need to think about it a little more and see the side-effect it could have to change that. |
Ok, I get what you're saying. I guess in this specific case allowing the user to control the padding makes more sense to me, but I know that child windows are used for a lot of different things in the framework and could affect a lot. A simple workaround was to just set the border color to the childBG color and not worry about it. |
Came back to that, initially decided to remove the inconsistency and require the user to set the padding to 0.0f. I then went and looked at merely the demo.cpp code and it became apparent that it would be an annoyance and break many people code (even if the breakage is so slight). In addition, it is a rather common pattern to create a "header" full of widget followed by a child filling the rest of the window, and that looks weirder with padding. So we can either:
I think I want to actually go for C there. |
…er child window uses window padding (#462)
… not honoring bordering (following #462)
Alright, I went for B seeing even C looked tedious from user's point of view, and added a flag Also fixed bug with ListBox(), InputTextMultiline() where the content would be misplaced when border was enabled on widgets, because of that same thing. |
I've created a "tool panel" style child window that is aligned with the left of the parent window. When I set it's border to 'false', all window padding seems to be ignored. I tried setting the default padding to something large like 20. When BeginChild is called with border=true, the padding shows like usual. When I pass false, the padding is ignored. I'm not sure if this is intended or not. I made a simple example to test this out:
(We have to make sure the childBG has a valid color)
Please let me know if this is something I'm doing wrong, working as intended, or if it's a bug. I can easily work around it for now, but it's just one of those annoying things :)
Thanks!
Don
The text was updated successfully, but these errors were encountered: