| 14832 | } |
| 14833 | |
| 14834 | static int StackToolFormatLevelInfo(ImGuiStackTool* tool, int n, bool format_for_ui, char* buf, size_t buf_size) |
| 14835 | { |
| 14836 | ImGuiStackLevelInfo* info = &tool->Results[n]; |
| 14837 | ImGuiWindow* window = (info->Desc[0] == 0 && n == 0) ? ImGui::FindWindowByID(info->ID) : NULL; |
| 14838 | if (window) // Source: window name (because the root ID don't call GetID() and so doesn't get hooked) |
| 14839 | return ImFormatString(buf, buf_size, format_for_ui ? "\"%s\" [window]" : "%s", window->Name); |
| 14840 | if (info->QuerySuccess) // Source: GetID() hooks (prioritize over ItemInfo() because we frequently use patterns like: PushID(str), Button("") where they both have same id) |
| 14841 | return ImFormatString(buf, buf_size, (format_for_ui && info->DataType == ImGuiDataType_String) ? "\"%s\"" : "%s", info->Desc); |
| 14842 | if (tool->StackLevel < tool->Results.Size) // Only start using fallback below when all queries are done, so during queries we don't flickering ??? markers. |
| 14843 | return (*buf = 0); |
| 14844 | #ifdef IMGUI_ENABLE_TEST_ENGINE |
| 14845 | if (const char* label = ImGuiTestEngine_FindItemDebugLabel(GImGui, info->ID)) // Source: ImGuiTestEngine's ItemInfo() |
| 14846 | return ImFormatString(buf, buf_size, format_for_ui ? "??? \"%s\"" : "%s", label); |
| 14847 | #endif |
| 14848 | return ImFormatString(buf, buf_size, "???"); |
| 14849 | } |
| 14850 | |
| 14851 | // Stack Tool: Display UI |
| 14852 | void ImGui::ShowStackToolWindow(bool* p_open) |
no test coverage detected