Open P-Squiddy opened 4 years ago
Constraining sizes is kind of conflicting with lots of the functionality of Docking, see #2849, #2690, #2428 (probably more threads).
What do you expect should be the desirable behavior in your example? I honestly don't know the answer. If _NoResize was affecting all touching nodes it would be a severe constraints which I believe lots of people would treat an as issue (it could essentially lock down resizing an entire dock tree).
We would need something along those lines to get e.g. Toolbars to work, but it opens lots of questions e.g.
It's a rather wide and open problem. Additionally, it would be useful if you could describe your specific use case in concrete term.
My expected behavior would be that if object B is docked inside object A, and object A has specified that it should NOT resize, object B should "inherit" that behavior (regardless of where the dock occurs).
In this case, I assume that since I've explicitly told ImGui I did not want to be able to resize object A, everything attached to that should follow the same constraints -- especially if the position to where it is docked is a Tab, vs Separation (i.e. docked in the middle square, vs North, South, East, West). The dock then becomes the template regarding widths/heights. As it is now, I can resize object B to be, say, 2x larger than the object it's going to be docked within, and the dock will shrink it to that space. If i then undock object B, object B does not return to its pre-docked size of 2x larger.
I could also see it being beneficial to be able to tell object A it couldn't resize, but tell object B that it COULD (explicitly) which would create a behavior where you could resize ONLY the "resizable portion", while leaving the other portions the same size.
My rational for this being that I, the programmer, told ImGui I did (or did not) want something (explicitly), therefore it is my responsibility to create something that adheres to that.
Perhaps a solution to this is either if the dock itself is marked _NoSize, it is not resizable (meaning that you mark a node as being the dock), or if all the windows in a dock are marked _NoSize, it is not resizable.
I believe this could work if you could explicitly create a dock, opposed to every window is potentially a dock.
Using the Win32 backend with D3D11, if I set a window as ImGuiWindowFlags_NoResize, then Dock any window inside of it, the window is resizable, regardless of the docked windows state. I tried to set ImGuiDockNodeFlags_NoResize as well, but it didn't affect it.
if this is expected behavior, is there a workaround for this?
https://drive.google.com/file/d/1l7BCIhMzcCYCVzfUJvTom53Z_hPlIpku/view?usp=sharing