27 const std::string& explicit_label,
28 const std::string& description) {
29 ImGuiContext* ctx = ImGui::GetCurrentContext();
30 if (!ctx || !ctx->CurrentWindow) {
35 ImGuiID imgui_id = ctx->LastItemData.ID;
41 std::string label = explicit_label;
43 label = absl::StrCat(widget_type,
"_", imgui_id);
47 std::string full_path;
55 full_path += absl::StrCat(widget_type,
":", normalized_label);
59 metadata.
label = label;
62 if (ctx->CurrentWindow) {
63 metadata.
window_name = std::string(ctx->CurrentWindow->Name);
67 const ImGuiLastItemData& last = ctx->LastItemData;
68 metadata.
visible = (last.StatusFlags & ImGuiItemStatusFlags_Visible) != 0;
69 metadata.
enabled = (last.ItemFlags & ImGuiItemFlags_Disabled) == 0;
73 bounds.
min_x = last.Rect.Min.x;
74 bounds.
min_y = last.Rect.Min.y;
75 bounds.
max_x = last.Rect.Max.x;
76 bounds.
max_y = last.Rect.Max.y;
82 full_path, widget_type, imgui_id, description, metadata);