mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-19 06:26:35 +00:00
This commit is contained in:
parent
9350158d61
commit
f208fd7ebb
@ -11915,17 +11915,17 @@ static void ImGui::DockNodeUpdate(ImGuiDockNode* node)
|
|||||||
if (host_window && node->Windows.Size > 0)
|
if (host_window && node->Windows.Size > 0)
|
||||||
{
|
{
|
||||||
DockNodeUpdateTabBar(node, host_window);
|
DockNodeUpdateTabBar(node, host_window);
|
||||||
if (node->TabBar->SelectedTabId)
|
|
||||||
node->SelectedTabID = node->TabBar->SelectedTabId;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
node->WantCloseAll = false;
|
node->WantCloseAll = false;
|
||||||
node->WantCloseTabID = 0;
|
node->WantCloseTabID = 0;
|
||||||
node->IsFocused = false;
|
node->IsFocused = false;
|
||||||
if (node->Windows.Size > 0)
|
|
||||||
node->SelectedTabID = node->Windows[0]->ID;
|
|
||||||
}
|
}
|
||||||
|
if (node->TabBar && node->TabBar->SelectedTabId)
|
||||||
|
node->SelectedTabID = node->TabBar->SelectedTabId;
|
||||||
|
else if (node->Windows.Size > 0)
|
||||||
|
node->SelectedTabID = node->Windows[0]->ID;
|
||||||
|
|
||||||
// Draw payload drop target
|
// Draw payload drop target
|
||||||
if (host_window && node->IsVisible)
|
if (host_window && node->IsVisible)
|
||||||
|
@ -4241,8 +4241,8 @@ static void ShowExampleAppCustomRendering(bool* p_open)
|
|||||||
void ShowExampleAppDockSpace(bool* p_open)
|
void ShowExampleAppDockSpace(bool* p_open)
|
||||||
{
|
{
|
||||||
static bool opt_fullscreen_persistant = true;
|
static bool opt_fullscreen_persistant = true;
|
||||||
static ImGuiDockNodeFlags opt_flags = ImGuiDockNodeFlags_None;
|
|
||||||
bool opt_fullscreen = opt_fullscreen_persistant;
|
bool opt_fullscreen = opt_fullscreen_persistant;
|
||||||
|
static ImGuiDockNodeFlags dockspace_flags = ImGuiDockNodeFlags_None;
|
||||||
|
|
||||||
// We are using the ImGuiWindowFlags_NoDocking flag to make the parent window not dockable into,
|
// We are using the ImGuiWindowFlags_NoDocking flag to make the parent window not dockable into,
|
||||||
// because it would be confusing to have two docking targets within each others.
|
// because it would be confusing to have two docking targets within each others.
|
||||||
@ -4260,7 +4260,7 @@ void ShowExampleAppDockSpace(bool* p_open)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// When using ImGuiDockNodeFlags_PassthruDockspace, DockSpace() will render our background and handle the pass-thru hole, so we ask Begin() to not render a background.
|
// When using ImGuiDockNodeFlags_PassthruDockspace, DockSpace() will render our background and handle the pass-thru hole, so we ask Begin() to not render a background.
|
||||||
if (opt_flags & ImGuiDockNodeFlags_PassthruDockspace)
|
if (dockspace_flags & ImGuiDockNodeFlags_PassthruDockspace)
|
||||||
window_flags |= ImGuiWindowFlags_NoBackground;
|
window_flags |= ImGuiWindowFlags_NoBackground;
|
||||||
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
|
||||||
@ -4275,7 +4275,7 @@ void ShowExampleAppDockSpace(bool* p_open)
|
|||||||
if (io.ConfigFlags & ImGuiConfigFlags_DockingEnable)
|
if (io.ConfigFlags & ImGuiConfigFlags_DockingEnable)
|
||||||
{
|
{
|
||||||
ImGuiID dockspace_id = ImGui::GetID("MyDockspace");
|
ImGuiID dockspace_id = ImGui::GetID("MyDockspace");
|
||||||
ImGui::DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), opt_flags);
|
ImGui::DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), dockspace_flags);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -4290,11 +4290,11 @@ void ShowExampleAppDockSpace(bool* p_open)
|
|||||||
// which we can't undo at the moment without finer window depth/z control.
|
// 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_persistant);
|
||||||
|
|
||||||
if (ImGui::MenuItem("Flag: NoSplit", "", (opt_flags & ImGuiDockNodeFlags_NoSplit) != 0)) opt_flags ^= ImGuiDockNodeFlags_NoSplit;
|
if (ImGui::MenuItem("Flag: NoSplit", "", (dockspace_flags & ImGuiDockNodeFlags_NoSplit) != 0)) dockspace_flags ^= ImGuiDockNodeFlags_NoSplit;
|
||||||
if (ImGui::MenuItem("Flag: NoDockingInCentralNode", "", (opt_flags & ImGuiDockNodeFlags_NoDockingInCentralNode) != 0)) opt_flags ^= ImGuiDockNodeFlags_NoDockingInCentralNode;
|
if (ImGui::MenuItem("Flag: NoDockingInCentralNode", "", (dockspace_flags & ImGuiDockNodeFlags_NoDockingInCentralNode) != 0)) dockspace_flags ^= ImGuiDockNodeFlags_NoDockingInCentralNode;
|
||||||
if (ImGui::MenuItem("Flag: NoResize", "", (opt_flags & ImGuiDockNodeFlags_NoResize) != 0)) opt_flags ^= ImGuiDockNodeFlags_NoResize;
|
if (ImGui::MenuItem("Flag: NoResize", "", (dockspace_flags & ImGuiDockNodeFlags_NoResize) != 0)) dockspace_flags ^= ImGuiDockNodeFlags_NoResize;
|
||||||
if (ImGui::MenuItem("Flag: PassthruDockspace", "", (opt_flags & ImGuiDockNodeFlags_PassthruDockspace) != 0)) opt_flags ^= ImGuiDockNodeFlags_PassthruDockspace;
|
if (ImGui::MenuItem("Flag: PassthruDockspace", "", (dockspace_flags & ImGuiDockNodeFlags_PassthruDockspace) != 0)) dockspace_flags ^= ImGuiDockNodeFlags_PassthruDockspace;
|
||||||
if (ImGui::MenuItem("Flag: AutoHideTabBar", "", (opt_flags & ImGuiDockNodeFlags_AutoHideTabBar) != 0)) opt_flags ^= ImGuiDockNodeFlags_AutoHideTabBar;
|
if (ImGui::MenuItem("Flag: AutoHideTabBar", "", (dockspace_flags & ImGuiDockNodeFlags_AutoHideTabBar) != 0)) dockspace_flags ^= ImGuiDockNodeFlags_AutoHideTabBar;
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
if (ImGui::MenuItem("Close DockSpace", NULL, false, p_open != NULL))
|
if (ImGui::MenuItem("Close DockSpace", NULL, false, p_open != NULL))
|
||||||
*p_open = false;
|
*p_open = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user