Skip to content
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

TestSuite: added "docking_dockspace_copy_no_remap" #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 34 additions & 0 deletions imgui_test_suite/imgui_tests_docking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2220,6 +2220,40 @@ void RegisterTests_Docking(ImGuiTestEngine* e)
}
};

// ## Test DockBuilderCopyDockSpace() when window not in remapping list (#6035)
#if IMGUI_VERSION_NUM > 18916
t = IM_REGISTER_TEST(e, "docking", "docking_dockspace_copy_no_remap");
t->GuiFunc = [](ImGuiTestContext* ctx)
{
ImGui::SetNextWindowSize({ 600.f, 300.f });
ImGui::Begin("Window0", nullptr, ImGuiWindowFlags_NoSavedSettings);
ImGuiID id0 = ImGui::GetID("DockSpace0");
ImGuiID id1 = ImGui::GetID("DockSpace1");

if (ImGui::Button("Copy"))
{
ImVector<const char*> remap;
ImGui::DockBuilderCopyDockSpace(id0, id1, &remap);
}

ImGui::DockSpace(id0, { 300.f, 300.f });
ImGui::SameLine();
ImGui::DockSpace(id1, { 300.f, 300.f });
ImGui::End();

ImGui::SetNextWindowSize({ 100.f, 100.f });
ImGui::Begin("Window1", nullptr, ImGuiWindowFlags_NoSavedSettings);
ImGui::End();
};
t->TestFunc = [](ImGuiTestContext* ctx)
{
ImGuiID dock_id = ctx->GetID("Window0/DockSpace0");
ctx->DockClear("Window1", nullptr);
ctx->DockInto("Window1", dock_id, ImGuiDir_Up);
ctx->ItemClick("Window0/Copy");
};
#endif

#else
IM_UNUSED(e);
#endif
Expand Down