MCPcopy Create free account
hub / github.com/BoomingTech/Piccolo / DockNodeUpdate

Method DockNodeUpdate

engine/3rdparty/imgui/imgui.cpp:14668–14964  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14666}
14667
14668static void ImGui::DockNodeUpdate(ImGuiDockNode* node)
14669{
14670 ImGuiContext& g = *GImGui;
14671 IM_ASSERT(node->LastFrameActive != g.FrameCount);
14672 node->LastFrameAlive = g.FrameCount;
14673 node->IsBgDrawnThisFrame = false;
14674
14675 node->CentralNode = node->OnlyNodeWithWindows = NULL;
14676 if (node->IsRootNode())
14677 DockNodeUpdateForRootNode(node);
14678
14679 // Remove tab bar if not needed
14680 if (node->TabBar && node->IsNoTabBar())
14681 DockNodeRemoveTabBar(node);
14682
14683 // Early out for hidden root dock nodes (when all DockId references are in inactive windows, or there is only 1 floating window holding on the DockId)
14684 bool want_to_hide_host_window = false;
14685 if (node->IsFloatingNode())
14686 {
14687 if (node->Windows.Size <= 1 && node->IsLeafNode())
14688 if (!g.IO.ConfigDockingAlwaysTabBar && (node->Windows.Size == 0 || !node->Windows[0]->WindowClass.DockingAlwaysTabBar))
14689 want_to_hide_host_window = true;
14690 if (node->CountNodeWithWindows == 0)
14691 want_to_hide_host_window = true;
14692 }
14693 if (want_to_hide_host_window)
14694 {
14695 if (node->Windows.Size == 1)
14696 {
14697 // Floating window pos/size is authoritative
14698 ImGuiWindow* single_window = node->Windows[0];
14699 node->Pos = single_window->Pos;
14700 node->Size = single_window->SizeFull;
14701 node->AuthorityForPos = node->AuthorityForSize = node->AuthorityForViewport = ImGuiDataAuthority_Window;
14702
14703 // Transfer focus immediately so when we revert to a regular window it is immediately selected
14704 if (node->HostWindow && g.NavWindow == node->HostWindow)
14705 FocusWindow(single_window);
14706 if (node->HostWindow)
14707 {
14708 single_window->Viewport = node->HostWindow->Viewport;
14709 single_window->ViewportId = node->HostWindow->ViewportId;
14710 if (node->HostWindow->ViewportOwned)
14711 {
14712 single_window->Viewport->Window = single_window;
14713 single_window->ViewportOwned = true;
14714 }
14715 }
14716 }
14717
14718 DockNodeHideHostWindow(node);
14719 node->State = ImGuiDockNodeState_HostWindowHiddenBecauseSingleWindow;
14720 node->WantCloseAll = false;
14721 node->WantCloseTabId = 0;
14722 node->HasCloseButton = node->HasWindowMenuButton = false;
14723 node->LastFrameActive = g.FrameCount;
14724
14725 if (node->WantMouseMove && node->Windows.Size == 1)

Callers

nothing calls this directly

Calls 8

ImVec2Function · 0.85
DockNodeSetupHostWindowFunction · 0.85
DockNodeGetRootNodeFunction · 0.85
IsDataTypeMethod · 0.80
ChannelsSetCurrentMethod · 0.80
AddRectFilledMethod · 0.80
IsEmptyMethod · 0.45

Tested by

no test coverage detected