Open caxapexac opened 2 years ago
I just use a simple boolean which I use to trigger a reset...
` void Editor::BeginDockspace() { ImGuiViewport* Viewport = ImGui::GetMainViewport(); ImGui::SetNextWindowPos( Viewport->WorkPos ); ImGui::SetNextWindowSize( Viewport->WorkSize ); ImGui::SetNextWindowViewport( Viewport->ID );
ImGuiWindowFlags WindowFlags = 0;
WindowFlags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDocking;
WindowFlags |= ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus;
ImGui::PushStyleVar( ImGuiStyleVar_WindowRounding, 0.0f );
ImGui::PushStyleVar( ImGuiStyleVar_WindowBorderSize, 0.0f );
ImGui::PushStyleVar( ImGuiStyleVar_WindowPadding, ImVec2( 0.0f, 0.0f ) );
ImGui::Begin( "##Editor", NULL, WindowFlags );
ImGui::PopStyleVar( 3 );
ImGuiID DockspaceID = ImGui::GetID( "##DockspaceID" );
if ( !ImGui::DockBuilderGetNode( DockspaceID ) || mResetLayout )
{
mResetLayout = false;
ImGui::DockBuilderRemoveNode( DockspaceID );
ImGui::DockBuilderAddNode( DockspaceID );
// Build dockspace...
ImGui::DockBuilderFinish( DockspaceID );
}
ImGui::DockSpace( DockspaceID );
}
`
@dgregorius looks working but pretty messy and unflexible Thanks, I'll definetely use it
@ocornut should we close this issue if there are no plans adding feature like ImGui::ResetAllDockings()
? Seems like it's not really needed for anybody except me :)
I'm keeping issues open until a decision is taken or solution implemented.
Version/Branch of Dear ImGui:
Version: 1.86 Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: webGL Compiler: em++ Operating System: V8
My Issue/Question:
I thought this line would reset positions of all the windows but it doesn't:
How to reset current context data such as windows docking and positions?