Skip to content

Commit

Permalink
Docking: removed DockNodeFlagsOverrideClear flags from ImGuiWindowCla…
Browse files Browse the repository at this point in the history
…ss. (#2999, #3521, #3633)

+ extraded bits of metrics into DebugNodeDockNodeFlags()
  • Loading branch information
ocornut committed Jul 5, 2021
1 parent 36a0d10 commit 0a8ab75
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ Docking+Viewports Branch:

- Docking: Clicking on the right-most close button of a docking node closes all windows. (#4186)
- Docking: Fix IsWindowAppearing() and ImGuiCond_Appearing on docked windows. (#4177, #3982, #1497, #1061)
- Docking: (Internal/Experimental) Removed DockNodeFlagsOverrideClear flags from ImGuiWindowClass as
it is ambiguous how to apply them and we haven't got a use out of them yet.
- Viewports: Fix popup/tooltip created without a parent window from being given a ParentViewportId value
from the implicit/fallback window. (#4236, #2409)
- Backends: Vulkan: Fix the use of the incorrect fence for secondary viewports. (#4208) [@FunMiles]
Expand Down
39 changes: 29 additions & 10 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13442,7 +13442,7 @@ static void ImGui::DockNodeUpdateVisibleFlagAndInactiveChilds(ImGuiDockNode* nod
else
{
// FIXME-DOCKING: Missing policies for conflict resolution, hence the "Experimental" tag on this.
node->LocalFlags &= ~window->WindowClass.DockNodeFlagsOverrideClear;
//node->LocalFlags &= ~window->WindowClass.DockNodeFlagsOverrideClear;
node->LocalFlags |= window->WindowClass.DockNodeFlagsOverrideSet;
}
}
Expand Down Expand Up @@ -16677,6 +16677,33 @@ void ImGui::DebugNodeColumns(ImGuiOldColumns* columns)
TreePop();
}

static void DebugNodeDockNodeFlags(ImGuiDockNodeFlags* p_flags, const char* label, bool enabled)
{
using namespace ImGui;
PushID(label);
PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0.0f, 0.0f));
Text("%s:", label);
if (!enabled)
PushDisabled();
CheckboxFlags("NoSplit", p_flags, ImGuiDockNodeFlags_NoSplit);
CheckboxFlags("NoResize", p_flags, ImGuiDockNodeFlags_NoResize);
CheckboxFlags("NoResizeX", p_flags, ImGuiDockNodeFlags_NoResizeX);
CheckboxFlags("NoResizeY",p_flags, ImGuiDockNodeFlags_NoResizeY);
CheckboxFlags("NoTabBar", p_flags, ImGuiDockNodeFlags_NoTabBar);
CheckboxFlags("HiddenTabBar", p_flags, ImGuiDockNodeFlags_HiddenTabBar);
CheckboxFlags("NoWindowMenuButton", p_flags, ImGuiDockNodeFlags_NoWindowMenuButton);
CheckboxFlags("NoCloseButton", p_flags, ImGuiDockNodeFlags_NoCloseButton);
CheckboxFlags("NoDocking", p_flags, ImGuiDockNodeFlags_NoDocking);
CheckboxFlags("NoDockingSplitMe", p_flags, ImGuiDockNodeFlags_NoDockingSplitMe);
CheckboxFlags("NoDockingSplitOther", p_flags, ImGuiDockNodeFlags_NoDockingSplitOther);
CheckboxFlags("NoDockingOverMe", p_flags, ImGuiDockNodeFlags_NoDockingOverMe);
CheckboxFlags("NoDockingOverOther", p_flags, ImGuiDockNodeFlags_NoDockingOverOther);
if (!enabled)
PopDisabled();
PopStyleVar();
PopID();
}

// [DEBUG] Display contents of ImDockNode
void ImGui::DebugNodeDockNode(ImGuiDockNode* node, const char* label)
{
Expand Down Expand Up @@ -16709,15 +16736,7 @@ void ImGui::DebugNodeDockNode(ImGuiDockNode* node, const char* label)
node->WantLockSizeOnce ? " WantLockSizeOnce" : "");
if (TreeNode("flags", "LocalFlags: 0x%04X SharedFlags: 0x%04X", node->LocalFlags, node->SharedFlags))
{
CheckboxFlags("LocalFlags: NoDocking", &node->LocalFlags, ImGuiDockNodeFlags_NoDocking);
CheckboxFlags("LocalFlags: NoSplit", &node->LocalFlags, ImGuiDockNodeFlags_NoSplit);
CheckboxFlags("LocalFlags: NoResize", &node->LocalFlags, ImGuiDockNodeFlags_NoResize);
CheckboxFlags("LocalFlags: NoResizeX", &node->LocalFlags, ImGuiDockNodeFlags_NoResizeX);
CheckboxFlags("LocalFlags: NoResizeY", &node->LocalFlags, ImGuiDockNodeFlags_NoResizeY);
CheckboxFlags("LocalFlags: NoTabBar", &node->LocalFlags, ImGuiDockNodeFlags_NoTabBar);
CheckboxFlags("LocalFlags: HiddenTabBar", &node->LocalFlags, ImGuiDockNodeFlags_HiddenTabBar);
CheckboxFlags("LocalFlags: NoWindowMenuButton", &node->LocalFlags, ImGuiDockNodeFlags_NoWindowMenuButton);
CheckboxFlags("LocalFlags: NoCloseButton", &node->LocalFlags, ImGuiDockNodeFlags_NoCloseButton);
DebugNodeDockNodeFlags(&node->LocalFlags, "LocalFlags", true);
TreePop();
}
if (node->ParentNode)
Expand Down
1 change: 0 additions & 1 deletion imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -2068,7 +2068,6 @@ struct ImGuiWindowClass
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.
ImGuiTabItemFlags TabItemFlagsOverrideSet; // [EXPERIMENTAL] TabItem flags to set when a window of this class gets submitted into a dock node tab bar. May use with ImGuiTabItemFlags_Leading or ImGuiTabItemFlags_Trailing.
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 DockingAllowUnclassed; // Set to true to allow windows of this class to be docked/merged with an unclassed window. // FIXME-DOCK: Move to DockNodeFlags override?

Expand Down

0 comments on commit 0a8ab75

Please sign in to comment.