|
@@ -438,6 +438,9 @@ CODE
|
|
|
- likewise io.MousePos and GetMousePos() will use OS coordinates.
|
|
|
If you query mouse positions to interact with non-imgui coordinates you will need to offset them, e.g. subtract GetWindowViewport()->Pos.
|
|
|
|
|
|
+ - 2024/05/21 (1.90.7) - docking: changed signature of DockSpaceOverViewport() to add explicit dockspace id if desired. pass 0 to use old behavior. (#7611)
|
|
|
+ - old: DockSpaceOverViewport(const ImGuiViewport* viewport = NULL, ImGuiDockNodeFlags flags = 0, ...);
|
|
|
+ - new: DockSpaceOverViewport(ImGuiID dockspace_id = 0, const ImGuiViewport* viewport = NULL, ImGuiDockNodeFlags flags = 0, ...);
|
|
|
- 2024/05/16 (1.90.7) - inputs: on macOS X, Cmd and Ctrl keys are now automatically swapped by io.AddKeyEvent() as this naturally align with how macOS X uses those keys.
|
|
|
- it shouldn't really affect you unless you had custom shortcut swapping in place for macOS X apps.
|
|
|
- removed ImGuiMod_Shortcut which was previously dynamically remapping to Ctrl or Cmd/Super. It is now unnecessary to specific cross-platform idiomatic shortcuts. (#2343, #4084, #5923, #456)
|
|
@@ -18488,7 +18491,7 @@ void ImGui::SetWindowDock(ImGuiWindow* window, ImGuiID dock_id, ImGuiCond cond)
|
|
|
// The Central Node is always displayed even when empty and shrink/extend according to the requested size of its neighbors.
|
|
|
// DockSpace() needs to be submitted _before_ any window they can host. If you use a dockspace, submit it early in your app.
|
|
|
// When ImGuiDockNodeFlags_KeepAliveOnly is set, nothing is submitted in the current window (function may be called from any location).
|
|
|
-ImGuiID ImGui::DockSpace(ImGuiID id, const ImVec2& size_arg, ImGuiDockNodeFlags flags, const ImGuiWindowClass* window_class)
|
|
|
+ImGuiID ImGui::DockSpace(ImGuiID dockspace_id, const ImVec2& size_arg, ImGuiDockNodeFlags flags, const ImGuiWindowClass* window_class)
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
ImGuiWindow* window = GetCurrentWindowRead();
|
|
@@ -18504,16 +18507,16 @@ ImGuiID ImGui::DockSpace(ImGuiID id, const ImVec2& size_arg, ImGuiDockNodeFlags
|
|
|
window = GetCurrentWindow(); // call to set window->WriteAccessed = true;
|
|
|
|
|
|
IM_ASSERT((flags & ImGuiDockNodeFlags_DockSpace) == 0);
|
|
|
- IM_ASSERT(id != 0);
|
|
|
- ImGuiDockNode* node = DockContextFindNodeByID(&g, id);
|
|
|
- if (!node)
|
|
|
+ IM_ASSERT(dockspace_id != 0);
|
|
|
+ ImGuiDockNode* node = DockContextFindNodeByID(&g, dockspace_id);
|
|
|
+ if (node == NULL)
|
|
|
{
|
|
|
- IMGUI_DEBUG_LOG_DOCKING("[docking] DockSpace: dockspace node 0x%08X created\n", id);
|
|
|
- node = DockContextAddNode(&g, id);
|
|
|
+ IMGUI_DEBUG_LOG_DOCKING("[docking] DockSpace: dockspace node 0x%08X created\n", dockspace_id);
|
|
|
+ node = DockContextAddNode(&g, dockspace_id);
|
|
|
node->SetLocalFlags(ImGuiDockNodeFlags_CentralNode);
|
|
|
}
|
|
|
if (window_class && window_class->ClassId != node->WindowClass.ClassId)
|
|
|
- IMGUI_DEBUG_LOG_DOCKING("[docking] DockSpace: dockspace node 0x%08X: setup WindowClass 0x%08X -> 0x%08X\n", id, node->WindowClass.ClassId, window_class->ClassId);
|
|
|
+ IMGUI_DEBUG_LOG_DOCKING("[docking] DockSpace: dockspace node 0x%08X: setup WindowClass 0x%08X -> 0x%08X\n", dockspace_id, node->WindowClass.ClassId, window_class->ClassId);
|
|
|
node->SharedFlags = flags;
|
|
|
node->WindowClass = window_class ? *window_class : ImGuiWindowClass();
|
|
|
|
|
@@ -18523,7 +18526,7 @@ ImGuiID ImGui::DockSpace(ImGuiID id, const ImVec2& size_arg, ImGuiDockNodeFlags
|
|
|
{
|
|
|
IM_ASSERT(node->IsDockSpace() == false && "Cannot call DockSpace() twice a frame with the same ID");
|
|
|
node->SetLocalFlags(node->LocalFlags | ImGuiDockNodeFlags_DockSpace);
|
|
|
- return id;
|
|
|
+ return dockspace_id;
|
|
|
}
|
|
|
node->SetLocalFlags(node->LocalFlags | ImGuiDockNodeFlags_DockSpace);
|
|
|
|
|
@@ -18531,7 +18534,7 @@ ImGuiID ImGui::DockSpace(ImGuiID id, const ImVec2& size_arg, ImGuiDockNodeFlags
|
|
|
if (flags & ImGuiDockNodeFlags_KeepAliveOnly)
|
|
|
{
|
|
|
node->LastFrameAlive = g.FrameCount;
|
|
|
- return id;
|
|
|
+ return dockspace_id;
|
|
|
}
|
|
|
|
|
|
const ImVec2 content_avail = GetContentRegionAvail();
|
|
@@ -18556,7 +18559,7 @@ ImGuiID ImGui::DockSpace(ImGuiID id, const ImVec2& size_arg, ImGuiDockNodeFlags
|
|
|
window_flags |= ImGuiWindowFlags_NoBackground;
|
|
|
|
|
|
char title[256];
|
|
|
- ImFormatString(title, IM_ARRAYSIZE(title), "%s/DockSpace_%08X", window->Name, id);
|
|
|
+ ImFormatString(title, IM_ARRAYSIZE(title), "%s/DockSpace_%08X", window->Name, dockspace_id);
|
|
|
|
|
|
PushStyleVar(ImGuiStyleVar_ChildBorderSize, 0.0f);
|
|
|
Begin(title, NULL, window_flags);
|
|
@@ -18585,22 +18588,23 @@ ImGuiID ImGui::DockSpace(ImGuiID id, const ImVec2& size_arg, ImGuiDockNodeFlags
|
|
|
|
|
|
ImRect bb(node->Pos, node->Pos + size);
|
|
|
ItemSize(size);
|
|
|
- ItemAdd(bb, id, NULL, ImGuiItemFlags_NoNav); // Not a nav point (could be, would need to draw the nav rect and replicate/refactor activation from BeginChild(), but seems like CTRL+Tab works better here?)
|
|
|
+ ItemAdd(bb, dockspace_id, NULL, ImGuiItemFlags_NoNav); // Not a nav point (could be, would need to draw the nav rect and replicate/refactor activation from BeginChild(), but seems like CTRL+Tab works better here?)
|
|
|
if ((g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HoveredRect) && IsWindowChildOf(g.HoveredWindow, host_window, false, true)) // To fullfill IsItemHovered(), similar to EndChild()
|
|
|
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HoveredWindow;
|
|
|
|
|
|
- return id;
|
|
|
+ return dockspace_id;
|
|
|
}
|
|
|
|
|
|
// Tips: Use with ImGuiDockNodeFlags_PassthruCentralNode!
|
|
|
-// The limitation with this call is that your window won't have a menu bar.
|
|
|
+// The limitation with this call is that your window won't have a local menu bar, but you can also use BeginMainMenuBar().
|
|
|
// Even though we could pass window flags, it would also require the user to be able to call BeginMenuBar() somehow meaning we can't Begin/End in a single function.
|
|
|
-// But you can also use BeginMainMenuBar(). If you really want a menu bar inside the same window as the one hosting the dockspace, you will need to copy this code somewhere and tweak it.
|
|
|
-ImGuiID ImGui::DockSpaceOverViewport(const ImGuiViewport* viewport, ImGuiDockNodeFlags dockspace_flags, const ImGuiWindowClass* window_class)
|
|
|
+// If you really want a menu bar inside the same window as the one hosting the dockspace, you will need to copy this code somewhere and tweak it.
|
|
|
+ImGuiID ImGui::DockSpaceOverViewport(ImGuiID dockspace_id, const ImGuiViewport* viewport, ImGuiDockNodeFlags dockspace_flags, const ImGuiWindowClass* window_class)
|
|
|
{
|
|
|
if (viewport == NULL)
|
|
|
viewport = GetMainViewport();
|
|
|
|
|
|
+ // Submit a window filling the entire viewport
|
|
|
SetNextWindowPos(viewport->WorkPos);
|
|
|
SetNextWindowSize(viewport->WorkSize);
|
|
|
SetNextWindowViewport(viewport->ID);
|
|
@@ -18612,7 +18616,7 @@ ImGuiID ImGui::DockSpaceOverViewport(const ImGuiViewport* viewport, ImGuiDockNod
|
|
|
host_window_flags |= ImGuiWindowFlags_NoBackground;
|
|
|
|
|
|
char label[32];
|
|
|
- ImFormatString(label, IM_ARRAYSIZE(label), "DockSpaceViewport_%08X", viewport->ID);
|
|
|
+ ImFormatString(label, IM_ARRAYSIZE(label), "WindowOverViewport_%08X", viewport->ID);
|
|
|
|
|
|
PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
|
|
|
PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
|
|
@@ -18620,8 +18624,11 @@ ImGuiID ImGui::DockSpaceOverViewport(const ImGuiViewport* viewport, ImGuiDockNod
|
|
|
Begin(label, NULL, host_window_flags);
|
|
|
PopStyleVar(3);
|
|
|
|
|
|
- ImGuiID dockspace_id = GetID("DockSpace");
|
|
|
+ // Submit the dockspace
|
|
|
+ if (dockspace_id == 0)
|
|
|
+ dockspace_id = GetID("DockSpace");
|
|
|
DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), dockspace_flags, window_class);
|
|
|
+
|
|
|
End();
|
|
|
|
|
|
return dockspace_id;
|