mirror of
https://github.com/ocornut/imgui.git
synced 2024-12-03 05:29:10 +08:00
Internals: Docking: rename HoveredDockNode to DebugHoveredDockNode to clarify that it isn't usable for much other than debugging.
This commit is contained in:
parent
8cbd391f09
commit
b78738ff23
12
imgui.cpp
12
imgui.cpp
@ -13998,13 +13998,13 @@ void ImGui::DockContextNewFrameUpdateDocking(ImGuiContext* ctx)
|
||||
// [DEBUG] Store hovered dock node.
|
||||
// We could in theory use DockNodeTreeFindVisibleNodeByPos() on the root host dock node, but using ->DockNode is a good shortcut.
|
||||
// Note this is mostly a debug thing and isn't actually used for docking target, because docking involve more detailed filtering.
|
||||
g.HoveredDockNode = NULL;
|
||||
g.DebugHoveredDockNode = NULL;
|
||||
if (ImGuiWindow* hovered_window = g.HoveredWindowUnderMovingWindow)
|
||||
{
|
||||
if (hovered_window->DockNodeAsHost)
|
||||
g.HoveredDockNode = DockNodeTreeFindVisibleNodeByPos(hovered_window->DockNodeAsHost, g.IO.MousePos);
|
||||
g.DebugHoveredDockNode = DockNodeTreeFindVisibleNodeByPos(hovered_window->DockNodeAsHost, g.IO.MousePos);
|
||||
else if (hovered_window->RootWindow->DockNode)
|
||||
g.HoveredDockNode = hovered_window->RootWindow->DockNode;
|
||||
g.DebugHoveredDockNode = hovered_window->RootWindow->DockNode;
|
||||
}
|
||||
|
||||
// Process Docking requests
|
||||
@ -18250,7 +18250,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
||||
Text("HoveredWindow: '%s'", g.HoveredWindow ? g.HoveredWindow->Name : "NULL");
|
||||
Text("HoveredWindow->Root: '%s'", g.HoveredWindow ? g.HoveredWindow->RootWindowDockTree->Name : "NULL");
|
||||
Text("HoveredWindowUnderMovingWindow: '%s'", g.HoveredWindowUnderMovingWindow ? g.HoveredWindowUnderMovingWindow->Name : "NULL");
|
||||
Text("HoveredDockNode: 0x%08X", g.HoveredDockNode ? g.HoveredDockNode->ID : 0);
|
||||
Text("HoveredDockNode: 0x%08X", g.DebugHoveredDockNode ? g.DebugHoveredDockNode->ID : 0);
|
||||
Text("MovingWindow: '%s'", g.MovingWindow ? g.MovingWindow->Name : "NULL");
|
||||
Text("MouseViewport: 0x%08X (UserHovered 0x%08X, LastHovered 0x%08X)", g.MouseViewport->ID, g.IO.MouseHoveredViewport, g.MouseLastHoveredViewport ? g.MouseLastHoveredViewport->ID : 0);
|
||||
Unindent();
|
||||
@ -18338,11 +18338,11 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
||||
|
||||
#ifdef IMGUI_HAS_DOCK
|
||||
// Overlay: Display Docking info
|
||||
if (cfg->ShowDockingNodes && g.IO.KeyCtrl && g.HoveredDockNode)
|
||||
if (cfg->ShowDockingNodes && g.IO.KeyCtrl && g.DebugHoveredDockNode)
|
||||
{
|
||||
char buf[64] = "";
|
||||
char* p = buf;
|
||||
ImGuiDockNode* node = g.HoveredDockNode;
|
||||
ImGuiDockNode* node = g.DebugHoveredDockNode;
|
||||
ImDrawList* overlay_draw_list = node->HostWindow ? GetForegroundDrawList(node->HostWindow) : GetForegroundDrawList(GetMainViewport());
|
||||
p += ImFormatString(p, buf + IM_ARRAYSIZE(buf) - p, "DockId: %X%s\n", node->ID, node->IsCentralNode() ? " *CentralNode*" : "");
|
||||
p += ImFormatString(p, buf + IM_ARRAYSIZE(buf) - p, "WindowClass: %08X\n", node->WindowClass.ClassId);
|
||||
|
@ -1800,7 +1800,6 @@ struct ImGuiContext
|
||||
ImGuiWindow* CurrentWindow; // Window being drawn into
|
||||
ImGuiWindow* HoveredWindow; // Window the mouse is hovering. Will typically catch mouse inputs.
|
||||
ImGuiWindow* HoveredWindowUnderMovingWindow; // Hovered window ignoring MovingWindow. Only set if MovingWindow is set.
|
||||
ImGuiDockNode* HoveredDockNode; // [Debug] Hovered dock node.
|
||||
ImGuiWindow* MovingWindow; // Track the window we clicked on (in order to preserve focus). The actual window that is moved is generally MovingWindow->RootWindowDockTree.
|
||||
ImGuiWindow* WheelingWindow; // Track the window we started mouse-wheeling on. Until a timer elapse or mouse has moved, generally keep scrolling the same window even if during the course of scrolling the mouse ends up hovering a child window.
|
||||
ImVec2 WheelingWindowRefMousePos;
|
||||
@ -2033,6 +2032,7 @@ struct ImGuiContext
|
||||
ImGuiID DebugItemPickerBreakId; // Will call IM_DEBUG_BREAK() when encountering this ID
|
||||
ImGuiMetricsConfig DebugMetricsConfig;
|
||||
ImGuiStackTool DebugStackTool;
|
||||
ImGuiDockNode* DebugHoveredDockNode; // Hovered dock node.
|
||||
|
||||
// Misc
|
||||
float FramerateSecPerFrame[60]; // Calculate estimate of framerate for user over the last 60 frames..
|
||||
@ -2064,7 +2064,6 @@ struct ImGuiContext
|
||||
CurrentWindow = NULL;
|
||||
HoveredWindow = NULL;
|
||||
HoveredWindowUnderMovingWindow = NULL;
|
||||
HoveredDockNode = NULL;
|
||||
MovingWindow = NULL;
|
||||
WheelingWindow = NULL;
|
||||
WheelingWindowTimer = 0.0f;
|
||||
@ -2199,6 +2198,7 @@ struct ImGuiContext
|
||||
DebugItemPickerActive = false;
|
||||
DebugItemPickerMouseButton = ImGuiMouseButton_Left;
|
||||
DebugItemPickerBreakId = 0;
|
||||
DebugHoveredDockNode = NULL;
|
||||
|
||||
memset(FramerateSecPerFrame, 0, sizeof(FramerateSecPerFrame));
|
||||
FramerateSecPerFrameIdx = FramerateSecPerFrameCount = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user