Text with a little bullet aligned to the typical tree node.
| 425 | |
| 426 | // Text with a little bullet aligned to the typical tree node. |
| 427 | void ImGui::BulletTextV(const char* fmt, va_list args) |
| 428 | { |
| 429 | ImGuiWindow* window = GetCurrentWindow(); |
| 430 | if (window->SkipItems) |
| 431 | return; |
| 432 | |
| 433 | ImGuiContext& g = *GImGui; |
| 434 | const ImGuiStyle& style = g.Style; |
| 435 | |
| 436 | const char* text_begin, *text_end; |
| 437 | ImFormatStringToTempBufferV(&text_begin, &text_end, fmt, args); |
| 438 | const ImVec2 label_size = CalcTextSize(text_begin, text_end, false); |
| 439 | const ImVec2 total_size = ImVec2(g.FontSize + (label_size.x > 0.0f ? (label_size.x + style.FramePadding.x * 2) : 0.0f), label_size.y); // Empty text doesn't add padding |
| 440 | ImVec2 pos = window->DC.CursorPos; |
| 441 | pos.y += window->DC.CurrLineTextBaseOffset; |
| 442 | ItemSize(total_size, 0.0f); |
| 443 | const ImRect bb(pos, pos + total_size); |
| 444 | if (!ItemAdd(bb, 0)) |
| 445 | return; |
| 446 | |
| 447 | // Render |
| 448 | ImU32 text_col = GetColorU32(ImGuiCol_Text); |
| 449 | RenderBullet(window->DrawList, bb.Min + ImVec2(style.FramePadding.x + g.FontSize * 0.5f, g.FontSize * 0.5f), text_col); |
| 450 | RenderText(bb.Min + ImVec2(g.FontSize + style.FramePadding.x * 2, 0.0f), text_begin, text_end, false); |
| 451 | } |
| 452 | |
| 453 | //------------------------------------------------------------------------- |
| 454 | // [SECTION] Widgets: Main |
nothing calls this directly
no test coverage detected