MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / DockNodeWindowMenuHandler_Default

Method DockNodeWindowMenuHandler_Default

imgui_tiny_app/imgui/imgui.cpp:19332–19355  ·  view source on GitHub ↗

Default handler for g.DockNodeWindowMenuHandler(): display the list of windows for a given dock-node. This is exceptionally stored in a function pointer to also user applications to tweak this menu (undocumented) Custom overrides may want to decorate, group, sort entries. Please note those are internal structures: if you copy this expect occasional breakage. (if you don't need to modify the "Tabs.

Source from the content-addressed store, hash-verified

19330// Please note those are internal structures: if you copy this expect occasional breakage.
19331// (if you don't need to modify the "Tabs.Size == 1" behavior/path it is recommend you call this function in your handler)
19332void ImGui::DockNodeWindowMenuHandler_Default(ImGuiContext* ctx, ImGuiDockNode* node, ImGuiTabBar* tab_bar)
19333{
19334 IM_UNUSED(ctx);
19335 if (tab_bar->Tabs.Size == 1)
19336 {
19337 // "Hide tab bar" option. Being one of our rare user-facing string we pull it from a table.
19338 if (MenuItem(LocalizeGetMsg(ImGuiLocKey_DockingHideTabBar), NULL, node->IsHiddenTabBar()))
19339 node->WantHiddenTabBarToggle = true;
19340 }
19341 else
19342 {
19343 // Display a selectable list of windows in this docking node
19344 for (int tab_n = 0; tab_n < tab_bar->Tabs.Size; tab_n++)
19345 {
19346 ImGuiTabItem* tab = &tab_bar->Tabs[tab_n];
19347 if (tab->Flags & ImGuiTabItemFlags_Button)
19348 continue;
19349 if (Selectable(TabBarGetTabName(tab_bar, tab), tab->ID == tab_bar->SelectedTabId))
19350 TabBarQueueFocus(tab_bar, tab);
19351 SameLine();
19352 Text(" ");
19353 }
19354 }
19355}
19356
19357static void ImGui::DockNodeWindowMenuUpdate(ImGuiDockNode* node, ImGuiTabBar* tab_bar)
19358{

Callers

nothing calls this directly

Calls 1

LocalizeGetMsgFunction · 0.85

Tested by

no test coverage detected