Open IceLuna opened 1 year ago
If you create a DockSpace()
inside your window you can dock other windows into it.
See Demo->Examples->Dockspace and Demo->Examples->Documents.
Yes, I've tried it but I don't see a way to recreate UE's behavior. I did something like this
I have Viewport
and Details
windows like in UE. But the key that is missing is a tab containing both windows (in UE-screenshot it's called T_Test
). And I can't dock these two windows to something else without undocking them.
I guess I need some kind of Parent/Upper window that will carry Viewport
and Details
windows along with it.
That’s exactly what DockSpace() does and I don’t see a dockspace in your image above. Be mindful that a hidden dockspace needs to be still be submitted using the _KeepAlive flag else its child windows will be undocked if it stops being submitted.
You can then use SetNextWindowClass() to perform some filtering, so top level windows can only be combined with each others, and tool windows can only be docked in a top-level window.
Sorry, but I can't seem to understand it and get it right. I've tried playing with Demo->Examples->Dockspace
and Demo->Examples->Documents
and couldn't get what I want. This is what I have right now:
ImGui::Begin("Tab/Parent window");
ImGui::DockSpace(dockspace_id1, ImVec2(0.0f, 0.0f), ImGuiDockNodeFlags_KeepAliveOnly);
ImGui::End();
ImGui::Begin("MyViewport");
ImGui::DockSpace(dockspace_id2, ImVec2(0.0f, 0.0f), ImGuiDockNodeFlags_KeepAliveOnly);
ImGui::End();
ImGui::Begin("Details");
ImGui::DockSpace(dockspace_id3, ImVec2(0.0f, 0.0f), ImGuiDockNodeFlags_KeepAliveOnly);
ImGui::End();
My goal result is something like this
Version/Branch of Dear ImGui:
Version: 1.89.4 WIP Branch: docking
My Issue/Question:
Hi! I want to make UI like in unreal engine and my question is: is there a way to dock windows to a tab? On a screenshot below you can see a texture-viewer tab (called
T_Test
) and it has docked windows (Viewport, Details, etc). Also these docked windows are moved along with a texture-viewer tab How can I achieve that? Couldn't find anything like this in issues and inImGui::ShowDemoWindow()
I hope I didn't miss anything :) Thanks!Screenshots/Video