mirror of
https://github.com/ocornut/imgui.git
synced 2024-12-01 02:37:24 +01:00
Docking: added ImGuiDockNodeFlags_DockedWindowsInFocusRoute to configure a dock node to automatically set ParentWindowForFocusRoute on its docked windows. (#6798, #2637, #456)
This commit is contained in:
parent
cceff4684a
commit
80c83a4277
@ -58,6 +58,9 @@ Docking+Viewports Branch:
|
|||||||
- Added ImGuiWindowClass::FocusRouteParentWindowId as a way to connect the focus route between
|
- Added ImGuiWindowClass::FocusRouteParentWindowId as a way to connect the focus route between
|
||||||
a tool window to a parent document window, so that Shortcuts in the documents are routed when the
|
a tool window to a parent document window, so that Shortcuts in the documents are routed when the
|
||||||
tool is focused (regardless of whether the tool is docked or in a floating viewport, etc.) (#6798)
|
tool is focused (regardless of whether the tool is docked or in a floating viewport, etc.) (#6798)
|
||||||
|
- Added ImGuiDockNodeFlags_DockedWindowsInFocusRoute to automatically make a dockspace connect
|
||||||
|
the focus route of its docked window. This is provided a convenience in case you have windows
|
||||||
|
where a connection is not explicit. (#6798)
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
|
@ -6844,6 +6844,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||||||
// There's little point to expose a flag to set this: because the interesting cases won't be using parent_window_in_stack,
|
// There's little point to expose a flag to set this: because the interesting cases won't be using parent_window_in_stack,
|
||||||
// Use for 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;
|
window->ParentWindowForFocusRoute = (window->RootWindow != window) ? parent_window_in_stack : NULL;
|
||||||
|
if (window->ParentWindowForFocusRoute == NULL && window->DockNode != NULL)
|
||||||
|
if (window->DockNode->MergedFlags & ImGuiDockNodeFlags_DockedWindowsInFocusRoute)
|
||||||
|
window->ParentWindowForFocusRoute = window->DockNode->HostWindow;
|
||||||
|
|
||||||
// Override with SetNextWindowClass() field or direct call to SetWindowParentWindowForFocusRoute()
|
// Override with SetNextWindowClass() field or direct call to SetWindowParentWindowForFocusRoute()
|
||||||
if (window->WindowClass.FocusRouteParentWindowId != 0)
|
if (window->WindowClass.FocusRouteParentWindowId != 0)
|
||||||
@ -20380,6 +20383,7 @@ static void DebugNodeDockNodeFlags(ImGuiDockNodeFlags* p_flags, const char* labe
|
|||||||
CheckboxFlags("HiddenTabBar", p_flags, ImGuiDockNodeFlags_HiddenTabBar);
|
CheckboxFlags("HiddenTabBar", p_flags, ImGuiDockNodeFlags_HiddenTabBar);
|
||||||
CheckboxFlags("NoWindowMenuButton", p_flags, ImGuiDockNodeFlags_NoWindowMenuButton);
|
CheckboxFlags("NoWindowMenuButton", p_flags, ImGuiDockNodeFlags_NoWindowMenuButton);
|
||||||
CheckboxFlags("NoCloseButton", p_flags, ImGuiDockNodeFlags_NoCloseButton);
|
CheckboxFlags("NoCloseButton", p_flags, ImGuiDockNodeFlags_NoCloseButton);
|
||||||
|
CheckboxFlags("DockedWindowsInFocusRoute", p_flags, ImGuiDockNodeFlags_DockedWindowsInFocusRoute);
|
||||||
CheckboxFlags("NoDocking", p_flags, ImGuiDockNodeFlags_NoDocking); // Multiple flags
|
CheckboxFlags("NoDocking", p_flags, ImGuiDockNodeFlags_NoDocking); // Multiple flags
|
||||||
CheckboxFlags("NoDockingSplit", p_flags, ImGuiDockNodeFlags_NoDockingSplit);
|
CheckboxFlags("NoDockingSplit", p_flags, ImGuiDockNodeFlags_NoDockingSplit);
|
||||||
CheckboxFlags("NoDockingSplitOther", p_flags, ImGuiDockNodeFlags_NoDockingSplitOther);
|
CheckboxFlags("NoDockingSplitOther", p_flags, ImGuiDockNodeFlags_NoDockingSplitOther);
|
||||||
|
@ -1723,6 +1723,7 @@ enum ImGuiDockNodeFlagsPrivate_
|
|||||||
ImGuiDockNodeFlags_NoCloseButton = 1 << 15, // Saved // Disable close button
|
ImGuiDockNodeFlags_NoCloseButton = 1 << 15, // Saved // Disable close button
|
||||||
ImGuiDockNodeFlags_NoResizeX = 1 << 16, // //
|
ImGuiDockNodeFlags_NoResizeX = 1 << 16, // //
|
||||||
ImGuiDockNodeFlags_NoResizeY = 1 << 17, // //
|
ImGuiDockNodeFlags_NoResizeY = 1 << 17, // //
|
||||||
|
ImGuiDockNodeFlags_DockedWindowsInFocusRoute= 1 << 18, // // Any docked window will be automatically be focus-route chained (window->ParentWindowForFocusRoute set to this) so Shortcut() in this window can run when any docked window is focused.
|
||||||
// Disable docking/undocking actions in this dockspace or individual node (existing docked nodes will be preserved)
|
// Disable docking/undocking actions in this dockspace or individual node (existing docked nodes will be preserved)
|
||||||
// Those are not exposed in public because the desirable sharing/inheriting/copy-flag-on-split behaviors are quite difficult to design and understand.
|
// Those are not exposed in public because the desirable sharing/inheriting/copy-flag-on-split behaviors are quite difficult to design and understand.
|
||||||
// The two public flags ImGuiDockNodeFlags_NoDockingOverCentralNode/ImGuiDockNodeFlags_NoDockingSplit don't have those issues.
|
// The two public flags ImGuiDockNodeFlags_NoDockingOverCentralNode/ImGuiDockNodeFlags_NoDockingSplit don't have those issues.
|
||||||
|
Loading…
Reference in New Issue
Block a user