|
|
|
@ -5303,8 +5303,8 @@ static void ShowExampleAppCustomRendering(bool* p_open) |
|
|
|
|
// DockSpace() is only useful to construct to a central location for your application.
|
|
|
|
|
void ShowExampleAppDockSpace(bool* p_open) |
|
|
|
|
{ |
|
|
|
|
static bool opt_fullscreen_persistant = true; |
|
|
|
|
bool opt_fullscreen = opt_fullscreen_persistant; |
|
|
|
|
static bool opt_fullscreen = true; |
|
|
|
|
static bool opt_padding = false; |
|
|
|
|
static ImGuiDockNodeFlags dockspace_flags = ImGuiDockNodeFlags_None; |
|
|
|
|
|
|
|
|
|
// We are using the ImGuiWindowFlags_NoDocking flag to make the parent window not dockable into,
|
|
|
|
@ -5321,6 +5321,10 @@ void ShowExampleAppDockSpace(bool* p_open) |
|
|
|
|
window_flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove; |
|
|
|
|
window_flags |= ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
dockspace_flags &= ~ImGuiDockNodeFlags_PassthruCentralNode; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// When using ImGuiDockNodeFlags_PassthruCentralNode, DockSpace() will render our background
|
|
|
|
|
// and handle the pass-thru hole, so we ask Begin() to not render a background.
|
|
|
|
@ -5332,8 +5336,10 @@ void ShowExampleAppDockSpace(bool* p_open) |
|
|
|
|
// all active windows docked into it will lose their parent and become undocked.
|
|
|
|
|
// We cannot preserve the docking relationship between an active window and an inactive docking, otherwise
|
|
|
|
|
// any change of dockspace/settings would lead to windows being stuck in limbo and never being visible.
|
|
|
|
|
if (!opt_padding) |
|
|
|
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f)); |
|
|
|
|
ImGui::Begin("DockSpace Demo", p_open, window_flags); |
|
|
|
|
if (!opt_padding) |
|
|
|
|
ImGui::PopStyleVar(); |
|
|
|
|
|
|
|
|
|
if (opt_fullscreen) |
|
|
|
@ -5353,19 +5359,22 @@ void ShowExampleAppDockSpace(bool* p_open) |
|
|
|
|
|
|
|
|
|
if (ImGui::BeginMenuBar()) |
|
|
|
|
{ |
|
|
|
|
if (ImGui::BeginMenu("Docking")) |
|
|
|
|
if (ImGui::BeginMenu("Options")) |
|
|
|
|
{ |
|
|
|
|
// Disabling fullscreen would allow the window to be moved to the front of other windows,
|
|
|
|
|
// which we can't undo at the moment without finer window depth/z control.
|
|
|
|
|
//ImGui::MenuItem("Fullscreen", NULL, &opt_fullscreen_persistant);
|
|
|
|
|
ImGui::MenuItem("Fullscreen", NULL, &opt_fullscreen); |
|
|
|
|
ImGui::MenuItem("Padding", NULL, &opt_padding); |
|
|
|
|
ImGui::Separator(); |
|
|
|
|
|
|
|
|
|
if (ImGui::MenuItem("Flag: NoSplit", "", (dockspace_flags & ImGuiDockNodeFlags_NoSplit) != 0)) dockspace_flags ^= ImGuiDockNodeFlags_NoSplit; |
|
|
|
|
if (ImGui::MenuItem("Flag: NoResize", "", (dockspace_flags & ImGuiDockNodeFlags_NoResize) != 0)) dockspace_flags ^= ImGuiDockNodeFlags_NoResize; |
|
|
|
|
if (ImGui::MenuItem("Flag: NoDockingInCentralNode", "", (dockspace_flags & ImGuiDockNodeFlags_NoDockingInCentralNode) != 0)) dockspace_flags ^= ImGuiDockNodeFlags_NoDockingInCentralNode; |
|
|
|
|
if (ImGui::MenuItem("Flag: PassthruCentralNode", "", (dockspace_flags & ImGuiDockNodeFlags_PassthruCentralNode) != 0)) dockspace_flags ^= ImGuiDockNodeFlags_PassthruCentralNode; |
|
|
|
|
if (ImGui::MenuItem("Flag: AutoHideTabBar", "", (dockspace_flags & ImGuiDockNodeFlags_AutoHideTabBar) != 0)) dockspace_flags ^= ImGuiDockNodeFlags_AutoHideTabBar; |
|
|
|
|
if (ImGui::MenuItem("Flag: NoSplit", "", (dockspace_flags & ImGuiDockNodeFlags_NoSplit) != 0)) { dockspace_flags ^= ImGuiDockNodeFlags_NoSplit; } |
|
|
|
|
if (ImGui::MenuItem("Flag: NoResize", "", (dockspace_flags & ImGuiDockNodeFlags_NoResize) != 0)) { dockspace_flags ^= ImGuiDockNodeFlags_NoResize; } |
|
|
|
|
if (ImGui::MenuItem("Flag: NoDockingInCentralNode", "", (dockspace_flags & ImGuiDockNodeFlags_NoDockingInCentralNode) != 0)) { dockspace_flags ^= ImGuiDockNodeFlags_NoDockingInCentralNode; } |
|
|
|
|
if (ImGui::MenuItem("Flag: AutoHideTabBar", "", (dockspace_flags & ImGuiDockNodeFlags_AutoHideTabBar) != 0)) { dockspace_flags ^= ImGuiDockNodeFlags_AutoHideTabBar; } |
|
|
|
|
if (ImGui::MenuItem("Flag: PassthruCentralNode", "", (dockspace_flags & ImGuiDockNodeFlags_PassthruCentralNode) != 0, opt_fullscreen)) { dockspace_flags ^= ImGuiDockNodeFlags_PassthruCentralNode; } |
|
|
|
|
ImGui::Separator(); |
|
|
|
|
if (ImGui::MenuItem("Close DockSpace", NULL, false, p_open != NULL)) |
|
|
|
|
|
|
|
|
|
if (ImGui::MenuItem("Close", NULL, false, p_open != NULL)) |
|
|
|
|
*p_open = false; |
|
|
|
|
ImGui::EndMenu(); |
|
|
|
|
} |
|
|
|
|