-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Dockspace windows sizes with fixed ratios #6095
Comments
At heart we should be able to enforce constraints to docked windows (#2849). Also see the toolbar hack in #2648.
Best to simply not do it ihmo. Unfortunately there are many similar topics and until we can make meaningful steps forward with Docking, I myself cannot be working on figuring out further elaborate workarounds. |
Thanks, I understand you have too much on your plate. I think I have found a satisfactory solution using the DockBuilder API now that I understand it better. |
Could you share the solution? I come with similar problems。 |
@WeakKnight It's basically understanding how that there is a 'central node' and that takes up the space that is left, while other docked windows keep a fixed size. For me this was enough. I created separate dock as my central node, and have windows docked on the sides. |
Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_sdl2.cpp + imgui_impl_opengl3.cpp
Compiler: Apple clang version 12.0.5 (clang-1205.0.22.11)
Operating System: MacOS
My Issue/Question:
I'm trying to make the windows docked in docking space have fixed size ratios when resizing, like in #5209. This is so that I can create a viewport with multiple views of a scene. Now if I understand correctly, this is currently not possible, and dear imgui handles the sizing differently. From #5209 I used the code provided to make a resizable dockspace that keeps the ratios fixed. This is done by rebuilding the dockspace whenever the window is resized:
Like this, I can add two buttons for splitting the window either horizontally or vertically and keep track of the splits (kinda duplicating work unfortunately). Does this make sense to do it this way or is there an easier/more efficient way of achieving what I want?
Furthermore, I want the user to be able to modify the ratios by dragging. For this I need to any changes to the window sizes and rebuild the dockspace with the new ratios. Trying this out, I noticed that
ImGui::GetWindowSize()
does not give the size I expected, since taking the ratio with the containing window size, does not give the ratio of the split. I figured that this difference comes from the window divider. Is this correct? If so, is there a way to get the divider element size?The text was updated successfully, but these errors were encountered: