mirror of
https://github.com/ocornut/imgui.git
synced 2026-03-30 13:05:23 -05:00
Docking: added ImGuiWindowClass::FocusRouteParentWindowId as a public facing version of SetWindowParentWindowForFocusRoute() (#6798, #2637, #456)
This commit is contained in:
10
imgui.cpp
10
imgui.cpp
@@ -6840,9 +6840,17 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
UpdateWindowParentAndRootLinks(window, flags, parent_window);
|
||||
window->ParentWindowInBeginStack = parent_window_in_stack;
|
||||
|
||||
// Focus route
|
||||
// There's little point to expose a flag to set this: because the interesting cases won't be using parent_window_in_stack,
|
||||
// e.g. linking a tool window in a standalone viewport to a document window, regardless of their Begin() stack parenting. (#6798)
|
||||
// Use for e.g. linking a tool window in a standalone viewport to a document window, regardless of their Begin() stack parenting. (#6798)
|
||||
window->ParentWindowForFocusRoute = (window->RootWindow != window) ? parent_window_in_stack : NULL;
|
||||
|
||||
// Override with SetNextWindowClass() field or direct call to SetWindowParentWindowForFocusRoute()
|
||||
if (window->WindowClass.FocusRouteParentWindowId != 0)
|
||||
{
|
||||
window->ParentWindowForFocusRoute = FindWindowByID(window->WindowClass.FocusRouteParentWindowId);
|
||||
IM_ASSERT(window->ParentWindowForFocusRoute != 0); // Invalid value for FocusRouteParentWindowId.
|
||||
}
|
||||
}
|
||||
|
||||
// Add to focus scope stack
|
||||
|
||||
Reference in New Issue
Block a user