| 22798 | } |
| 22799 | |
| 22800 | static int StackToolFormatLevelInfo(ImGuiIDStackTool* tool, int n, bool format_for_ui, char* buf, size_t buf_size) |
| 22801 | { |
| 22802 | ImGuiStackLevelInfo* info = &tool->Results[n]; |
| 22803 | ImGuiWindow* window = (info->Desc[0] == 0 && n == 0) ? ImGui::FindWindowByID(info->ID) : NULL; |
| 22804 | if (window) // Source: window name (because the root ID don't call GetID() and so doesn't get hooked) |
| 22805 | return ImFormatString(buf, buf_size, format_for_ui ? "\"%s\" [window]" : "%s", window->Name); |
| 22806 | if (info->QuerySuccess) // Source: GetID() hooks (prioritize over ItemInfo() because we frequently use patterns like: PushID(str), Button("") where they both have same id) |
| 22807 | return ImFormatString(buf, buf_size, (format_for_ui && info->DataType == ImGuiDataType_String) ? "\"%s\"" : "%s", info->Desc); |
| 22808 | if (tool->StackLevel < tool->Results.Size) // Only start using fallback below when all queries are done, so during queries we don't flickering ??? markers. |
| 22809 | return (*buf = 0); |
| 22810 | #ifdef IMGUI_ENABLE_TEST_ENGINE |
| 22811 | if (const char* label = ImGuiTestEngine_FindItemDebugLabel(GImGui, info->ID)) // Source: ImGuiTestEngine's ItemInfo() |
| 22812 | return ImFormatString(buf, buf_size, format_for_ui ? "??? \"%s\"" : "%s", label); |
| 22813 | #endif |
| 22814 | return ImFormatString(buf, buf_size, "???"); |
| 22815 | } |
| 22816 | |
| 22817 | // ID Stack Tool: Display UI |
| 22818 | void ImGui::ShowIDStackToolWindow(bool* p_open) |
no test coverage detected