Open ChivenZhang opened 11 months ago
If the node is created with DockBuilderAddNode()
you should not pass the ImGuiDockNodeFlags_DockSpace
flag the first time you create it. Sorry it is confusingly named, this has been a common issue to correct.
If you don't specify ImGuiDockNodeFlags_NoDockingInCentralNode
and ImGuiDockNodeFlags_PassthruCentralNode
, you should be able to use the central node like any normal node. So if you just dock windows into the central node, it should be central only as a formality, same effect as if you didn't have one.
Note that Central Node has different sizing behavior as normal node, as it always use "remaining size" rather than preserving its size.
The reason why I hide central node is that no-central node would share the same ratio when maximum the window.
If I place any widget in the central node, it would not keep its size ratio when resizing the window. So the question is how to keep the resize ratio among all dock widgets ? I couldn't use dock builder as I need the imgui to save layout to imgui.ini.
Note that Central Node has different sizing behavior as normal node, as it always use "remaining size" rather than preserving its size.
I think It's more natual for no-central node to use remaining size when there's no central node. It just my personal advice that from the experience of using Qt's QMainWindow and QDockWidget.
I answered your question. When you create the node don't use the ImGuiDockNodeFlags_DockSpace
flag you will have no central node. You may need to delete/clean your .ini data from past data.
I don't create node by dock builder, I just drag dock widget to dock layout and save its layout. Can it be possible to cancel the central area when dragging docking window ?
Where are you dragging into? an already created window or a dockspace?
Where are you dragging into? an already created window or a dockspace? It's into dockspace.
Version/Branch of Dear ImGui:
Version: 1.89 Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_OpenGL3.cpp + imgui_impl_SDL2.cpp Compiler: vs2019 msvc Operating System: windows 11
My Issue/Question:
I want to hide central node in docking layout. I remember there was a IMGUI_DOCK_FLAGS_NO_CENTRAL_NODE enum before, but it's missed now. How can I hide it using latest api? Thanks.