MCPcopy Create free account
hub / github.com/RenderKit/embree / SetItemDefaultFocus

Method SetItemDefaultFocus

tutorials/common/imgui/imgui.cpp:7733–7750  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7731}
7732
7733void ImGui::SetItemDefaultFocus()
7734{
7735 ImGuiContext& g = *GImGui;
7736 ImGuiWindow* window = g.CurrentWindow;
7737 if (!window->Appearing)
7738 return;
7739 if (g.NavWindow != window->RootWindowForNav || (!g.NavInitRequest && g.NavInitResultId == 0) || g.NavLayer != window->DC.NavLayerCurrent)
7740 return;
7741
7742 g.NavInitRequest = false;
7743 g.NavInitResultId = g.LastItemData.ID;
7744 g.NavInitResultRectRel = WindowRectAbsToRel(window, g.LastItemData.Rect);
7745 NavUpdateAnyRequestFlag();
7746
7747 // Scroll could be done in NavInitRequestApplyResult() via an opt-in flag (we however don't want regular init requests to scroll)
7748 if (!IsItemVisible())
7749 ScrollToRectEx(window, g.LastItemData.Rect, ImGuiScrollFlags_None);
7750}
7751
7752void ImGui::SetStateStorage(ImGuiStorage* tree)
7753{

Callers

nothing calls this directly

Calls 1

WindowRectAbsToRelFunction · 0.85

Tested by

no test coverage detected