mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Docking: Rename typo Autority -> Authority + Rename DockContextNewFrameUpdateDocking -> DockContextUpdateDocking.
This commit is contained in:
64
imgui.cpp
64
imgui.cpp
@ -3734,7 +3734,7 @@ void ImGui::NewFrame()
|
||||
|
||||
// Undocking
|
||||
// (needs to be before UpdateMouseMovingWindowNewFrame so the window is already offset and following the mouse on the detaching frame)
|
||||
DockContextNewFrameUpdateUndocking(&g);
|
||||
DockContextUpdateUndocking(&g);
|
||||
|
||||
// Find hovered window
|
||||
// (needs to be before UpdateMouseMovingWindowNewFrame so we fill g.HoveredWindowUnderMovingWindow on the mouse release frame)
|
||||
@ -3810,7 +3810,7 @@ void ImGui::NewFrame()
|
||||
ClosePopupsOverWindow(g.NavWindow);
|
||||
|
||||
// Docking
|
||||
DockContextNewFrameUpdateDocking(&g);
|
||||
DockContextUpdateDocking(&g);
|
||||
|
||||
// Create implicit/fallback window - which we will only render it if the user has added something to it.
|
||||
// We don't use "Debug" to avoid colliding with user trying to create a "Debug" window with custom flags.
|
||||
@ -10979,7 +10979,7 @@ void ImGui::DockContextRebuild(ImGuiContext* ctx)
|
||||
}
|
||||
|
||||
// Docking context update function, called by NewFrame()
|
||||
void ImGui::DockContextNewFrameUpdateUndocking(ImGuiContext* ctx)
|
||||
void ImGui::DockContextUpdateUndocking(ImGuiContext* ctx)
|
||||
{
|
||||
ImGuiContext& g = *ctx;
|
||||
ImGuiDockContext* dc = ctx->DockContext;
|
||||
@ -11023,7 +11023,7 @@ void ImGui::DockContextNewFrameUpdateUndocking(ImGuiContext* ctx)
|
||||
}
|
||||
|
||||
// Docking context update function, called by NewFrame()
|
||||
void ImGui::DockContextNewFrameUpdateDocking(ImGuiContext* ctx)
|
||||
void ImGui::DockContextUpdateDocking(ImGuiContext* ctx)
|
||||
{
|
||||
ImGuiContext& g = *ctx;
|
||||
ImGuiDockContext* dc = ctx->DockContext;
|
||||
@ -11181,7 +11181,7 @@ static void ImGui::DockContextBuildNodesFromSettings(ImGuiContext* ctx, ImGuiDoc
|
||||
node->Pos = ImVec2(settings->Pos.x, settings->Pos.y);
|
||||
node->Size = ImVec2(settings->Size.x, settings->Size.y);
|
||||
node->SizeRef = ImVec2(settings->SizeRef.x, settings->SizeRef.y);
|
||||
node->AutorityForPos = node->AutorityForSize = node->AutorityForViewport = ImGuiDataAutority_DockNode;
|
||||
node->AuthorityForPos = node->AuthorityForSize = node->AuthorityForViewport = ImGuiDataAuthority_DockNode;
|
||||
if (node->ParentNode && node->ParentNode->ChildNodes[0] == NULL)
|
||||
node->ParentNode->ChildNodes[0] = node;
|
||||
else if (node->ParentNode && node->ParentNode->ChildNodes[1] == NULL)
|
||||
@ -11423,9 +11423,9 @@ void ImGui::DockContextProcessUndockNode(ImGuiContext* ctx, ImGuiDockNode* node)
|
||||
int index_in_parent = (node->ParentNode->ChildNodes[0] == node) ? 0 : 1;
|
||||
node->ParentNode->ChildNodes[index_in_parent] = NULL;
|
||||
DockNodeTreeMerge(ctx, node->ParentNode, node->ParentNode->ChildNodes[index_in_parent ^ 1]);
|
||||
node->ParentNode->AutorityForViewport = ImGuiDataAutority_Window; // The node that stays in place keeps the viewport, so our newly dragged out node will create a new viewport
|
||||
node->ParentNode->AuthorityForViewport = ImGuiDataAuthority_Window; // The node that stays in place keeps the viewport, so our newly dragged out node will create a new viewport
|
||||
node->ParentNode = NULL;
|
||||
node->AutorityForPos = node->AutorityForSize = ImGuiDataAutority_Window;
|
||||
node->AuthorityForPos = node->AuthorityForSize = ImGuiDataAuthority_Window;
|
||||
node->WantMouseMove = true;
|
||||
}
|
||||
MarkIniSettingsDirty();
|
||||
@ -11449,8 +11449,8 @@ ImGuiDockNode::ImGuiDockNode(ImGuiID id)
|
||||
LastFocusedNodeID = 0;
|
||||
SelectedTabID = 0;
|
||||
WantCloseTabID = 0;
|
||||
AutorityForPos = AutorityForSize = ImGuiDataAutority_DockNode;
|
||||
AutorityForViewport = ImGuiDataAutority_Auto;
|
||||
AuthorityForPos = AuthorityForSize = ImGuiDataAuthority_DockNode;
|
||||
AuthorityForViewport = ImGuiDataAuthority_Auto;
|
||||
IsVisible = true;
|
||||
IsFocused = HasCloseButton = HasCollapseButton = false;
|
||||
WantCloseAll = WantLockSizeOnce = WantMouseMove = WantHiddenTabBarUpdate = WantHiddenTabBarToggle = false;
|
||||
@ -11502,12 +11502,12 @@ static void ImGui::DockNodeAddWindow(ImGuiDockNode* node, ImGuiWindow* window, b
|
||||
// In particular it is important we init the viewport from the first window so we don't create two viewports and drop one.
|
||||
if (node->HostWindow == NULL && !node->IsDockSpace() && node->IsRootNode())
|
||||
{
|
||||
if (node->AutorityForPos == ImGuiDataAutority_Auto)
|
||||
node->AutorityForPos = ImGuiDataAutority_Window;
|
||||
if (node->AutorityForSize == ImGuiDataAutority_Auto)
|
||||
node->AutorityForSize = ImGuiDataAutority_Window;
|
||||
if (node->AutorityForViewport == ImGuiDataAutority_Auto)
|
||||
node->AutorityForViewport = ImGuiDataAutority_Window;
|
||||
if (node->AuthorityForPos == ImGuiDataAuthority_Auto)
|
||||
node->AuthorityForPos = ImGuiDataAuthority_Window;
|
||||
if (node->AuthorityForSize == ImGuiDataAuthority_Auto)
|
||||
node->AuthorityForSize = ImGuiDataAuthority_Window;
|
||||
if (node->AuthorityForViewport == ImGuiDataAuthority_Auto)
|
||||
node->AuthorityForViewport = ImGuiDataAuthority_Window;
|
||||
}
|
||||
|
||||
// Add to tab bar if requested
|
||||
@ -11847,7 +11847,7 @@ static void ImGui::DockNodeUpdate(ImGuiDockNode* node)
|
||||
}
|
||||
|
||||
DockNodeHideHostWindow(node);
|
||||
node->AutorityForPos = node->AutorityForSize = node->AutorityForViewport = ImGuiDataAutority_Window;
|
||||
node->AuthorityForPos = node->AuthorityForSize = node->AuthorityForViewport = ImGuiDataAuthority_Window;
|
||||
node->WantCloseAll = false;
|
||||
node->WantCloseTabID = 0;
|
||||
node->HasCloseButton = node->HasCollapseButton = false;
|
||||
@ -11886,23 +11886,23 @@ static void ImGui::DockNodeUpdate(ImGuiDockNode* node)
|
||||
ImGuiWindow* ref_window = (node->Windows.Size > 0) ? node->Windows[0] : NULL;
|
||||
|
||||
// Sync Pos
|
||||
if (node->AutorityForPos == ImGuiDataAutority_Window && ref_window)
|
||||
if (node->AuthorityForPos == ImGuiDataAuthority_Window && ref_window)
|
||||
SetNextWindowPos(ref_window->Pos);
|
||||
else if (node->AutorityForPos == ImGuiDataAutority_DockNode)
|
||||
else if (node->AuthorityForPos == ImGuiDataAuthority_DockNode)
|
||||
SetNextWindowPos(node->Pos);
|
||||
|
||||
// Sync Size
|
||||
if (node->AutorityForSize == ImGuiDataAutority_Window && ref_window)
|
||||
if (node->AuthorityForSize == ImGuiDataAuthority_Window && ref_window)
|
||||
SetNextWindowSize(ref_window->SizeFull);
|
||||
else if (node->AutorityForSize == ImGuiDataAutority_DockNode)
|
||||
else if (node->AuthorityForSize == ImGuiDataAuthority_DockNode)
|
||||
SetNextWindowSize(node->Size);
|
||||
|
||||
// Sync Collapsed
|
||||
if (node->AutorityForSize == ImGuiDataAutority_Window && ref_window)
|
||||
if (node->AuthorityForSize == ImGuiDataAuthority_Window && ref_window)
|
||||
SetNextWindowCollapsed(ref_window->Collapsed);
|
||||
|
||||
// Sync Viewport
|
||||
if (node->AutorityForViewport == ImGuiDataAutority_Window && ref_window)
|
||||
if (node->AuthorityForViewport == ImGuiDataAuthority_Window && ref_window)
|
||||
SetNextWindowViewport(ref_window->ViewportId);
|
||||
|
||||
SetNextWindowClass(&node->WindowClass);
|
||||
@ -11935,12 +11935,12 @@ static void ImGui::DockNodeUpdate(ImGuiDockNode* node)
|
||||
if (node->HostWindow->Appearing)
|
||||
BringWindowToDisplayFront(node->HostWindow);
|
||||
|
||||
node->AutorityForPos = node->AutorityForSize = node->AutorityForViewport = ImGuiDataAutority_Auto;
|
||||
node->AuthorityForPos = node->AuthorityForSize = node->AuthorityForViewport = ImGuiDataAuthority_Auto;
|
||||
}
|
||||
else if (node->ParentNode)
|
||||
{
|
||||
node->HostWindow = host_window = node->ParentNode->HostWindow;
|
||||
node->AutorityForPos = node->AutorityForSize = node->AutorityForViewport = ImGuiDataAutority_Auto;
|
||||
node->AuthorityForPos = node->AuthorityForSize = node->AuthorityForViewport = ImGuiDataAuthority_Auto;
|
||||
}
|
||||
if (node->WantMouseMove && node->HostWindow)
|
||||
DockNodeStartMouseMovingWindow(node, node->HostWindow);
|
||||
@ -12700,7 +12700,7 @@ void ImGui::DockNodeTreeMerge(ImGuiContext* ctx, ImGuiDockNode* parent_node, ImG
|
||||
DockSettingsRenameNodeReferences(child_1->ID, parent_node->ID);
|
||||
}
|
||||
DockNodeApplyPosSizeToWindows(parent_node);
|
||||
parent_node->AutorityForPos = parent_node->AutorityForSize = parent_node->AutorityForViewport = ImGuiDataAutority_Auto;
|
||||
parent_node->AuthorityForPos = parent_node->AuthorityForSize = parent_node->AuthorityForViewport = ImGuiDataAuthority_Auto;
|
||||
parent_node->VisibleWindow = merge_lead_child->VisibleWindow;
|
||||
parent_node->SizeRef = backup_last_explicit_size;
|
||||
|
||||
@ -13141,7 +13141,7 @@ void ImGui::DockBuilderSetNodePos(ImGuiID node_id, ImVec2 pos)
|
||||
if (node == NULL)
|
||||
return;
|
||||
node->Pos = pos;
|
||||
node->AutorityForPos = ImGuiDataAutority_DockNode;
|
||||
node->AuthorityForPos = ImGuiDataAuthority_DockNode;
|
||||
}
|
||||
|
||||
void ImGui::DockBuilderSetNodeSize(ImGuiID node_id, ImVec2 size)
|
||||
@ -13151,7 +13151,7 @@ void ImGui::DockBuilderSetNodeSize(ImGuiID node_id, ImVec2 size)
|
||||
if (node == NULL)
|
||||
return;
|
||||
node->Size = node->SizeRef = size;
|
||||
node->AutorityForSize = ImGuiDataAutority_DockNode;
|
||||
node->AuthorityForSize = ImGuiDataAuthority_DockNode;
|
||||
}
|
||||
|
||||
// If you create a regular node, both ref_pos/ref_size will position the window.
|
||||
@ -13200,8 +13200,8 @@ void ImGui::DockBuilderRemoveNodeChildNodes(ImGuiID root_id)
|
||||
return;
|
||||
bool has_central_node = false;
|
||||
|
||||
ImGuiDataAutority backup_root_node_autority_for_pos = root_node ? root_node->AutorityForPos : ImGuiDataAutority_Auto;
|
||||
ImGuiDataAutority backup_root_node_autority_for_size = root_node ? root_node->AutorityForSize : ImGuiDataAutority_Auto;
|
||||
ImGuiDataAuthority backup_root_node_authority_for_pos = root_node ? root_node->AuthorityForPos : ImGuiDataAuthority_Auto;
|
||||
ImGuiDataAuthority backup_root_node_authority_for_size = root_node ? root_node->AuthorityForSize : ImGuiDataAuthority_Auto;
|
||||
|
||||
// Process active windows
|
||||
ImVector<ImGuiDockNode*> nodes_to_remove;
|
||||
@ -13225,8 +13225,8 @@ void ImGui::DockBuilderRemoveNodeChildNodes(ImGuiID root_id)
|
||||
// Make sure we don't lose our current pos/size. (FIXME-DOCK: Consider tidying up that code in DockNodeAddWindow instead)
|
||||
if (root_node)
|
||||
{
|
||||
root_node->AutorityForPos = backup_root_node_autority_for_pos;
|
||||
root_node->AutorityForSize = backup_root_node_autority_for_size;
|
||||
root_node->AuthorityForPos = backup_root_node_authority_for_pos;
|
||||
root_node->AuthorityForSize = backup_root_node_authority_for_size;
|
||||
}
|
||||
|
||||
// Apply to settings
|
||||
@ -13527,7 +13527,7 @@ void ImGui::BeginDocked(ImGuiWindow* window, bool* p_open)
|
||||
if (node == NULL)
|
||||
{
|
||||
node = DockContextAddNode(ctx, window->DockId);
|
||||
node->AutorityForPos = node->AutorityForSize = node->AutorityForViewport = ImGuiDataAutority_Window;
|
||||
node->AuthorityForPos = node->AuthorityForSize = node->AuthorityForViewport = ImGuiDataAuthority_Window;
|
||||
if (auto_dock_node)
|
||||
node->LastFrameAlive = g.FrameCount;
|
||||
}
|
||||
|
Reference in New Issue
Block a user