Tips: Use with ImGuiDockNodeFlags_PassthruCentralNode! The limitation with this call is that your window won't have a menu bar. Even though we could pass window flags, it would also require the user to be able to call BeginMenuBar() somehow meaning we can't Begin/End in a single function. But you can also use BeginMainMenuBar(). If you really want a menu bar inside the same window as the one hosti
| 17249 | // Even though we could pass window flags, it would also require the user to be able to call BeginMenuBar() somehow meaning we can't Begin/End in a single function. |
| 17250 | // But you can also use BeginMainMenuBar(). If you really want a menu bar inside the same window as the one hosting the dockspace, you will need to copy this code somewhere and tweak it. |
| 17251 | ImGuiID ImGui::DockSpaceOverViewport(const ImGuiViewport* viewport, ImGuiDockNodeFlags dockspace_flags, const ImGuiWindowClass* window_class) |
| 17252 | { |
| 17253 | if (viewport == NULL) |
| 17254 | viewport = GetMainViewport(); |
| 17255 | |
| 17256 | SetNextWindowPos(viewport->WorkPos); |
| 17257 | SetNextWindowSize(viewport->WorkSize); |
| 17258 | SetNextWindowViewport(viewport->ID); |
| 17259 | |
| 17260 | ImGuiWindowFlags host_window_flags = 0; |
| 17261 | host_window_flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDocking; |
| 17262 | host_window_flags |= ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus; |
| 17263 | if (dockspace_flags & ImGuiDockNodeFlags_PassthruCentralNode) |
| 17264 | host_window_flags |= ImGuiWindowFlags_NoBackground; |
| 17265 | |
| 17266 | char label[32]; |
| 17267 | ImFormatString(label, IM_ARRAYSIZE(label), "DockSpaceViewport_%08X", viewport->ID); |
| 17268 | |
| 17269 | PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f); |
| 17270 | PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f); |
| 17271 | PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f)); |
| 17272 | Begin(label, NULL, host_window_flags); |
| 17273 | PopStyleVar(3); |
| 17274 | |
| 17275 | ImGuiID dockspace_id = GetID("DockSpace"); |
| 17276 | DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), dockspace_flags, window_class); |
| 17277 | End(); |
| 17278 | |
| 17279 | return dockspace_id; |
| 17280 | } |
| 17281 | |
| 17282 | //----------------------------------------------------------------------------- |
| 17283 | // Docking: Builder Functions |
nothing calls this directly
no test coverage detected