mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 09:27:00 +00:00
Docking: Added DockNodeFlagsOverrideSet/DockNodeFlagsOverrideClear (experimental)
This commit is contained in:
parent
f1b5c742ff
commit
f68075b333
10
imgui.cpp
10
imgui.cpp
@ -12313,6 +12313,7 @@ static void ImGui::DockNodeUpdateVisibleFlagAndInactiveChilds(ImGuiDockNode* nod
|
|||||||
DockNodeUpdateVisibleFlagAndInactiveChilds(node->ChildNodes[1]);
|
DockNodeUpdateVisibleFlagAndInactiveChilds(node->ChildNodes[1]);
|
||||||
|
|
||||||
// Remove inactive windows
|
// Remove inactive windows
|
||||||
|
// Merge node flags overrides stored in windows
|
||||||
for (int window_n = 0; window_n < node->Windows.Size; window_n++)
|
for (int window_n = 0; window_n < node->Windows.Size; window_n++)
|
||||||
{
|
{
|
||||||
ImGuiWindow* window = node->Windows[window_n];
|
ImGuiWindow* window = node->Windows[window_n];
|
||||||
@ -12336,6 +12337,11 @@ static void ImGui::DockNodeUpdateVisibleFlagAndInactiveChilds(ImGuiDockNode* nod
|
|||||||
DockNodeRemoveWindow(node, window, node->ID);
|
DockNodeRemoveWindow(node, window, node->ID);
|
||||||
window_n--;
|
window_n--;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
node->LocalFlags &= ~window->WindowClass.DockNodeFlagsOverrideClear;
|
||||||
|
node->LocalFlags |= window->WindowClass.DockNodeFlagsOverrideSet;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auto-hide tab bar option
|
// Auto-hide tab bar option
|
||||||
@ -12344,6 +12350,10 @@ static void ImGui::DockNodeUpdateVisibleFlagAndInactiveChilds(ImGuiDockNode* nod
|
|||||||
node->WantHiddenTabBarToggle = true;
|
node->WantHiddenTabBarToggle = true;
|
||||||
node->WantHiddenTabBarUpdate = false;
|
node->WantHiddenTabBarUpdate = false;
|
||||||
|
|
||||||
|
// Cancel toggling if we know our tab bar is enforced to be hidden at all times
|
||||||
|
if (node->WantHiddenTabBarToggle && node->VisibleWindow && (node->VisibleWindow->WindowClass.DockNodeFlagsOverrideSet & ImGuiDockNodeFlags_HiddenTabBar))
|
||||||
|
node->WantHiddenTabBarToggle = false;
|
||||||
|
|
||||||
// Apply toggles at a single point of the frame (here!)
|
// Apply toggles at a single point of the frame (here!)
|
||||||
if (node->Windows.Size > 1)
|
if (node->Windows.Size > 1)
|
||||||
node->LocalFlags &= ~ImGuiDockNodeFlags_HiddenTabBar;
|
node->LocalFlags &= ~ImGuiDockNodeFlags_HiddenTabBar;
|
||||||
|
4
imgui.h
4
imgui.h
@ -1646,10 +1646,12 @@ struct ImGuiWindowClass
|
|||||||
ImGuiID ParentViewportId; // Hint for the platform back-end. If non-zero, the platform back-end can create a parent<>child relationship between the platform windows. Not conforming back-ends are free to e.g. parent every viewport to the main viewport or not.
|
ImGuiID ParentViewportId; // Hint for the platform back-end. If non-zero, the platform back-end can create a parent<>child relationship between the platform windows. Not conforming back-ends are free to e.g. parent every viewport to the main viewport or not.
|
||||||
ImGuiViewportFlags ViewportFlagsOverrideSet; // Viewport flags to set when a window of this class owns a viewport. This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
ImGuiViewportFlags ViewportFlagsOverrideSet; // Viewport flags to set when a window of this class owns a viewport. This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
||||||
ImGuiViewportFlags ViewportFlagsOverrideClear; // Viewport flags to clear when a window of this class owns a viewport. This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
ImGuiViewportFlags ViewportFlagsOverrideClear; // Viewport flags to clear when a window of this class owns a viewport. This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
||||||
|
ImGuiDockNodeFlags DockNodeFlagsOverrideSet; // [EXPERIMENTAL] Dock node flags to set when a window of this class is hosted by a dock node (it doesn't have to be selected!)
|
||||||
|
ImGuiDockNodeFlags DockNodeFlagsOverrideClear; // [EXPERIMENTAL]
|
||||||
bool DockingAlwaysTabBar; // Set to true to enforce single floating windows of this class always having their own docking node (equivalent of setting the global io.ConfigDockingAlwaysTabBar)
|
bool DockingAlwaysTabBar; // Set to true to enforce single floating windows of this class always having their own docking node (equivalent of setting the global io.ConfigDockingAlwaysTabBar)
|
||||||
bool DockingAllowUnclassed; // Set to true to allow windows of this class to be docked/merged with an unclassed window.
|
bool DockingAllowUnclassed; // Set to true to allow windows of this class to be docked/merged with an unclassed window.
|
||||||
|
|
||||||
ImGuiWindowClass() { ClassId = 0; ParentViewportId = 0; ViewportFlagsOverrideSet = ViewportFlagsOverrideClear = 0x00; DockingAlwaysTabBar = false; DockingAllowUnclassed = true; }
|
ImGuiWindowClass() { ClassId = 0; ParentViewportId = 0; ViewportFlagsOverrideSet = ViewportFlagsOverrideClear = 0x00; DockNodeFlagsOverrideSet = DockNodeFlagsOverrideClear = 0x00; DockingAlwaysTabBar = false; DockingAllowUnclassed = true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Data payload for Drag and Drop operations: AcceptDragDropPayload(), GetDragDropPayload()
|
// Data payload for Drag and Drop operations: AcceptDragDropPayload(), GetDragDropPayload()
|
||||||
|
Loading…
Reference in New Issue
Block a user