| 17416 | } |
| 17417 | |
| 17418 | static void ShowDebugLogFlag(const char* name, ImGuiDebugLogFlags flags) |
| 17419 | { |
| 17420 | ImGuiContext& g = *GImGui; |
| 17421 | ImVec2 size(ImGui::GetFrameHeight() + g.Style.ItemInnerSpacing.x + ImGui::CalcTextSize(name).x, ImGui::GetFrameHeight()); |
| 17422 | SameLineOrWrap(size); // FIXME-LAYOUT: To be done automatically once we rework ItemSize/ItemAdd into ItemLayout. |
| 17423 | |
| 17424 | bool highlight_errors = (flags == ImGuiDebugLogFlags_EventError && g.DebugLogSkippedErrors > 0); |
| 17425 | if (highlight_errors) |
| 17426 | ImGui::PushStyleColor(ImGuiCol_Text, ImLerp(g.Style.Colors[ImGuiCol_Text], ImVec4(1.0f, 0.0f, 0.0f, 1.0f), 0.30f)); |
| 17427 | if (ImGui::CheckboxFlags(name, &g.DebugLogFlags, flags) && g.IO.KeyShift && (g.DebugLogFlags & flags) != 0) |
| 17428 | { |
| 17429 | g.DebugLogAutoDisableFrames = 2; |
| 17430 | g.DebugLogAutoDisableFlags |= flags; |
| 17431 | } |
| 17432 | if (highlight_errors) |
| 17433 | { |
| 17434 | ImGui::PopStyleColor(); |
| 17435 | ImGui::SetItemTooltip("%d past errors skipped.", g.DebugLogSkippedErrors); |
| 17436 | } |
| 17437 | else |
| 17438 | { |
| 17439 | ImGui::SetItemTooltip("Hold SHIFT when clicking to enable for 2 frames only (useful for spammy log entries)"); |
| 17440 | } |
| 17441 | } |
| 17442 | |
| 17443 | void ImGui::ShowDebugLogWindow(bool* p_open) |
| 17444 | { |
no test coverage detected