| 17806 | } |
| 17807 | |
| 17808 | static void ShowDebugLogFlag(const char* name, ImGuiDebugLogFlags flags) |
| 17809 | { |
| 17810 | ImGuiContext& g = *GImGui; |
| 17811 | ImVec2 size(ImGui::GetFrameHeight() + g.Style.ItemInnerSpacing.x + ImGui::CalcTextSize(name).x, ImGui::GetFrameHeight()); |
| 17812 | SameLineOrWrap(size); // FIXME-LAYOUT: To be done automatically once we rework ItemSize/ItemAdd into ItemLayout. |
| 17813 | |
| 17814 | bool highlight_errors = (flags == ImGuiDebugLogFlags_EventError && g.DebugLogSkippedErrors > 0); |
| 17815 | if (highlight_errors) |
| 17816 | ImGui::PushStyleColor(ImGuiCol_Text, ImLerp(g.Style.Colors[ImGuiCol_Text], ImVec4(1.0f, 0.0f, 0.0f, 1.0f), 0.30f)); |
| 17817 | if (ImGui::CheckboxFlags(name, &g.DebugLogFlags, flags) && g.IO.KeyShift && (g.DebugLogFlags & flags) != 0) |
| 17818 | { |
| 17819 | g.DebugLogAutoDisableFrames = 2; |
| 17820 | g.DebugLogAutoDisableFlags |= flags; |
| 17821 | } |
| 17822 | if (highlight_errors) |
| 17823 | { |
| 17824 | ImGui::PopStyleColor(); |
| 17825 | ImGui::SetItemTooltip("%d past errors skipped.", g.DebugLogSkippedErrors); |
| 17826 | } |
| 17827 | else |
| 17828 | { |
| 17829 | ImGui::SetItemTooltip("Hold Shift when clicking to enable for 2 frames only (useful for spammy log entries)"); |
| 17830 | } |
| 17831 | } |
| 17832 | |
| 17833 | void ImGui::ShowDebugLogWindow(bool* p_open) |
| 17834 | { |
no test coverage detected